diff --git a/go.mod b/go.mod index c8b227510..abd162257 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,13 @@ module github.com/integrations/terraform-provider-github/v6 -go 1.21 - -toolchain go1.22.0 +go 1.24.0 require ( github.com/client9/misspell v0.3.4 github.com/go-jose/go-jose/v3 v3.0.4 github.com/golangci/golangci-lint v1.59.1 - github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 + github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v82 v82.0.0 github.com/google/uuid v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 @@ -87,8 +86,8 @@ require ( github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.5.3 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect - github.com/google/go-cmp v0.6.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/go-querystring v1.2.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect diff --git a/go.sum b/go.sum index 2e469f29b..4f47e0b44 100644 --- a/go.sum +++ b/go.sum @@ -292,10 +292,17 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN 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-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +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/v66 v66.0.1-0.20241027130611-9e5757d5a766 h1:Ne77zoI0NHPnZ/GPRzTVsedUUrkrI2UcnS821dfqp28= github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-github/v82 v82.0.0/go.mod h1:hQ6Xo0VKfL8RZ7z1hSfB4fvISg0QqHOqe9BP0qo+WvM= 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/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 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= diff --git a/vendor/github.com/google/go-cmp/cmp/internal/function/func.go b/vendor/github.com/google/go-cmp/cmp/internal/function/func.go index d127d4362..def01a6be 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/function/func.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/function/func.go @@ -19,6 +19,7 @@ const ( tbFunc // func(T) bool ttbFunc // func(T, T) bool + ttiFunc // func(T, T) int trbFunc // func(T, R) bool tibFunc // func(T, I) bool trFunc // func(T) R @@ -28,11 +29,13 @@ const ( Transformer = trFunc // func(T) R ValueFilter = ttbFunc // func(T, T) bool Less = ttbFunc // func(T, T) bool + Compare = ttiFunc // func(T, T) int ValuePredicate = tbFunc // func(T) bool KeyValuePredicate = trbFunc // func(T, R) bool ) var boolType = reflect.TypeOf(true) +var intType = reflect.TypeOf(0) // IsType reports whether the reflect.Type is of the specified function type. func IsType(t reflect.Type, ft funcType) bool { @@ -49,6 +52,10 @@ func IsType(t reflect.Type, ft funcType) bool { if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == boolType { return true } + case ttiFunc: // func(T, T) int + if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == intType { + return true + } case trbFunc: // func(T, R) bool if ni == 2 && no == 1 && t.Out(0) == boolType { return true diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index 754496f3b..ba3fce81f 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -232,7 +232,15 @@ func (validator) apply(s *state, vx, vy reflect.Value) { if t := s.curPath.Index(-2).Type(); t.Name() != "" { // Named type with unexported fields. name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType - if _, ok := reflect.New(t).Interface().(error); ok { + isProtoMessage := func(t reflect.Type) bool { + m, ok := reflect.PointerTo(t).MethodByName("ProtoReflect") + return ok && m.Type.NumIn() == 1 && m.Type.NumOut() == 1 && + m.Type.Out(0).PkgPath() == "google.golang.org/protobuf/reflect/protoreflect" && + m.Type.Out(0).Name() == "Message" + } + if isProtoMessage(t) { + help = `consider using "google.golang.org/protobuf/testing/protocmp".Transform to compare proto.Message types` + } else if _, ok := reflect.New(t).Interface().(error); ok { help = "consider using cmpopts.EquateErrors to compare error values" } else if t.Comparable() { help = "consider using cmpopts.EquateComparable to compare comparable Go types" diff --git a/vendor/github.com/google/go-github/v66/github/actions_artifacts.go b/vendor/github.com/google/go-github/v66/github/actions_artifacts.go index e05a9a840..f804b809b 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v66/github/actions_artifacts.go @@ -50,22 +50,12 @@ 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 *ListArtifactsOptions) (*ArtifactList, *Response, error) { +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) if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/admin.go b/vendor/github.com/google/go-github/v66/github/admin.go index c932cbe6a..e93c2266b 100644 --- a/vendor/github.com/google/go-github/v66/github/admin.go +++ b/vendor/github.com/google/go-github/v66/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.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.14/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/vendor/github.com/google/go-github/v66/github/admin_orgs.go b/vendor/github.com/google/go-github/v66/github/admin_orgs.go index f1e728707..cb11fe47f 100644 --- a/vendor/github.com/google/go-github/v66/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v66/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.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.14/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.14/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/vendor/github.com/google/go-github/v66/github/admin_stats.go b/vendor/github.com/google/go-github/v66/github/admin_stats.go index 51b7d86fc..704126251 100644 --- a/vendor/github.com/google/go-github/v66/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v66/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.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/vendor/github.com/google/go-github/v66/github/admin_users.go b/vendor/github.com/google/go-github/v66/github/admin_users.go index e447f002a..82e568a0a 100644 --- a/vendor/github.com/google/go-github/v66/github/admin_users.go +++ b/vendor/github.com/google/go-github/v66/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.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.14/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.14/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.14/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/vendor/github.com/google/go-github/v66/github/attestations.go b/vendor/github.com/google/go-github/v66/github/attestations.go deleted file mode 100644 index 618d5d73f..000000000 --- a/vendor/github.com/google/go-github/v66/github/attestations.go +++ /dev/null @@ -1,27 +0,0 @@ -// 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/vendor/github.com/google/go-github/v66/github/authorizations.go b/vendor/github.com/google/go-github/v66/github/authorizations.go index 5e63a3efb..9bfff7330 100644 --- a/vendor/github.com/google/go-github/v66/github/authorizations.go +++ b/vendor/github.com/google/go-github/v66/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" @@ -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.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.14/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/vendor/github.com/google/go-github/v66/github/checks.go b/vendor/github.com/google/go-github/v66/github/checks.go index 711be207c..71e50c15f 100644 --- a/vendor/github.com/google/go-github/v66/github/checks.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/codesofconduct.go b/vendor/github.com/google/go-github/v66/github/codesofconduct.go index aba057417..7d7f9ef81 100644 --- a/vendor/github.com/google/go-github/v66/github/codesofconduct.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/copilot.go b/vendor/github.com/google/go-github/v66/github/copilot.go index 7ea13bd7c..2697b7185 100644 --- a/vendor/github.com/google/go-github/v66/github/copilot.go +++ b/vendor/github.com/google/go-github/v66/github/copilot.go @@ -8,9 +8,7 @@ package github import ( "context" "encoding/json" - "errors" "fmt" - "time" ) // CopilotService provides access to the Copilot-related functions @@ -53,7 +51,6 @@ 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. @@ -66,39 +63,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"` -} - func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { // Using an alias to avoid infinite recursion when calling json.Unmarshal type alias CopilotSeatDetails @@ -114,7 +78,6 @@ 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{}: @@ -124,7 +87,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { } if v["type"] == nil { - return errors.New("assignee type field is not set") + return fmt.Errorf("assignee type field is not set") } if t, ok := v["type"].(string); ok && t == "User" { @@ -217,34 +180,6 @@ 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 @@ -378,107 +313,3 @@ 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/vendor/github.com/google/go-github/v66/github/emojis.go b/vendor/github.com/google/go-github/v66/github/emojis.go index b7a03dd98..93ef232f6 100644 --- a/vendor/github.com/google/go-github/v66/github/emojis.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/event_types.go b/vendor/github.com/google/go-github/v66/github/event_types.go index 40ad919be..fbe56b20d 100644 --- a/vendor/github.com/google/go-github/v66/github/event_types.go +++ b/vendor/github.com/google/go-github/v66/github/event_types.go @@ -29,19 +29,6 @@ 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". // @@ -766,7 +753,8 @@ 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"` @@ -1517,22 +1505,6 @@ 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 @@ -1593,20 +1565,6 @@ 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/vendor/github.com/google/go-github/v66/github/git_commits.go b/vendor/github.com/google/go-github/v66/github/git_commits.go index fdb3d26ce..573d38be5 100644 --- a/vendor/github.com/google/go-github/v66/github/git_commits.go +++ b/vendor/github.com/google/go-github/v66/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, errors.New("commit must be provided") + return nil, nil, fmt.Errorf("commit must be provided") } if opts == nil { opts = &CreateCommitOptions{} diff --git a/vendor/github.com/google/go-github/v66/github/github-accessors.go b/vendor/github.com/google/go-github/v66/github/github-accessors.go index acc54e7d9..f8e303c43 100644 --- a/vendor/github.com/google/go-github/v66/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v66/github/github-accessors.go @@ -1646,54 +1646,6 @@ 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 { @@ -2710,190 +2662,6 @@ 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 { @@ -4342,14 +4110,6 @@ 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 { @@ -4358,22 +4118,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 { @@ -5614,14 +5358,6 @@ 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 { @@ -11286,14 +11022,6 @@ 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 { @@ -20062,22 +19790,6 @@ 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 { @@ -20526,14 +20238,6 @@ 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 { @@ -20902,604 +20606,68 @@ 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{} +// GetCommit returns the Commit field. +func (r *RepositoryTag) GetCommit() *Commit { + if r == nil { + return nil } - return *r.CreatedAt + return r.Commit } -// GetCurrentUserCanBypass returns the CurrentUserCanBypass field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetCurrentUserCanBypass() string { - if r == nil || r.CurrentUserCanBypass == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepositoryTag) GetName() string { + if r == nil || r.Name == nil { return "" } - return *r.CurrentUserCanBypass + return *r.Name } -// GetLinks returns the Links field. -func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLink { - if r == nil { - return nil +// GetTarballURL returns the TarballURL field if it's non-nil, zero value otherwise. +func (r *RepositoryTag) GetTarballURL() string { + if r == nil || r.TarballURL == nil { + return "" } - return r.Links + return *r.TarballURL } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetNodeID() string { - if r == nil || r.NodeID == nil { +// GetZipballURL returns the ZipballURL field if it's non-nil, zero value otherwise. +func (r *RepositoryTag) GetZipballURL() string { + if r == nil || r.ZipballURL == nil { return "" } - return *r.NodeID + return *r.ZipballURL } -// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetSourceType() string { - if r == nil || r.SourceType == nil { +// GetAffectedPackageName returns the AffectedPackageName field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetAffectedPackageName() string { + if r == nil || r.AffectedPackageName == nil { return "" } - return *r.SourceType + return *r.AffectedPackageName } -// GetTarget returns the Target field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetTarget() string { - if r == nil || r.Target == nil { +// GetAffectedRange returns the AffectedRange field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetAffectedRange() string { + if r == nil || r.AffectedRange == nil { return "" } - return *r.Target + return *r.AffectedRange } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { - if r == nil || r.UpdatedAt == nil { +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { return Timestamp{} } - return *r.UpdatedAt + return *r.CreatedAt } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetCodeScanningRule) GetParameters() *RuleCodeScanningParameters { - if r == nil { - return nil +// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetDismissedAt() Timestamp { + if r == nil || r.DismissedAt == nil { + return Timestamp{} } - 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 { - return nil - } - return r.Commit -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RepositoryTag) GetName() string { - if r == nil || r.Name == nil { - return "" - } - return *r.Name -} - -// GetTarballURL returns the TarballURL field if it's non-nil, zero value otherwise. -func (r *RepositoryTag) GetTarballURL() string { - if r == nil || r.TarballURL == nil { - return "" - } - return *r.TarballURL -} - -// GetZipballURL returns the ZipballURL field if it's non-nil, zero value otherwise. -func (r *RepositoryTag) GetZipballURL() string { - if r == nil || r.ZipballURL == nil { - return "" - } - return *r.ZipballURL -} - -// GetAffectedPackageName returns the AffectedPackageName field if it's non-nil, zero value otherwise. -func (r *RepositoryVulnerabilityAlert) GetAffectedPackageName() string { - if r == nil || r.AffectedPackageName == nil { - return "" - } - return *r.AffectedPackageName -} - -// GetAffectedRange returns the AffectedRange field if it's non-nil, zero value otherwise. -func (r *RepositoryVulnerabilityAlert) GetAffectedRange() string { - if r == nil || r.AffectedRange == nil { - return "" - } - return *r.AffectedRange -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *RepositoryVulnerabilityAlert) GetCreatedAt() Timestamp { - if r == nil || r.CreatedAt == nil { - return Timestamp{} - } - return *r.CreatedAt -} - -// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. -func (r *RepositoryVulnerabilityAlert) GetDismissedAt() Timestamp { - if r == nil || r.DismissedAt == nil { - return Timestamp{} - } - return *r.DismissedAt + return *r.DismissedAt } // GetDismisser returns the Dismisser field. @@ -21838,14 +21006,6 @@ 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 { @@ -21990,14 +21150,6 @@ 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 { @@ -22038,14 +21190,6 @@ 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 { @@ -22102,14 +21246,6 @@ 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 { @@ -22974,62 +22110,6 @@ 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/vendor/github.com/google/go-github/v66/github/github.go b/vendor/github.com/google/go-github/v66/github/github.go index 042a0b52e..22fbb9747 100644 --- a/vendor/github.com/google/go-github/v66/github/github.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/issues_labels.go b/vendor/github.com/google/go-github/v66/github/issues_labels.go index b97b00f3e..51e7fe6a5 100644 --- a/vendor/github.com/google/go-github/v66/github/issues_labels.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/messages.go b/vendor/github.com/google/go-github/v66/github/messages.go index 608c557cb..30c4fca93 100644 --- a/vendor/github.com/google/go-github/v66/github/messages.go +++ b/vendor/github.com/google/go-github/v66/github/messages.go @@ -46,80 +46,77 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. eventTypeMapping = map[string]interface{}{ - "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{}, + "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_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{}, } - // 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/vendor/github.com/google/go-github/v66/github/orgs_attestations.go b/vendor/github.com/google/go-github/v66/github/orgs_attestations.go deleted file mode 100644 index 3d5793c18..000000000 --- a/vendor/github.com/google/go-github/v66/github/orgs_attestations.go +++ /dev/null @@ -1,40 +0,0 @@ -// 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/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go deleted file mode 100644 index b25845a4e..000000000 --- a/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go +++ /dev/null @@ -1,284 +0,0 @@ -// 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/vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go b/vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go index 0954b92d4..695c4dade 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go +++ b/vendor/github.com/google/go-github/v66/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/enterprise-cloud@latest/rest/orgs/organization-roles#create-a-custom-organization-role +// 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) { @@ -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/enterprise-cloud@latest/rest/orgs/organization-roles#update-a-custom-organization-role +// 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) { @@ -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/enterprise-cloud@latest/rest/orgs/organization-roles#delete-a-custom-organization-role +// 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) { diff --git a/vendor/github.com/google/go-github/v66/github/orgs_properties.go b/vendor/github.com/google/go-github/v66/github/orgs_properties.go index d8db48fc9..3387d98d7 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v66/github/orgs_properties.go @@ -8,7 +8,6 @@ package github import ( "context" "encoding/json" - "errors" "fmt" ) @@ -70,7 +69,7 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { if str, ok := item.(string); ok { strSlice[i] = str } else { - return errors.New("non-string value in string array") + return fmt.Errorf("non-string value in string array") } } cpv.Value = strSlice diff --git a/vendor/github.com/google/go-github/v66/github/pulls.go b/vendor/github.com/google/go-github/v66/github/pulls.go index 35ceda446..b66850269 100644 --- a/vendor/github.com/google/go-github/v66/github/pulls.go +++ b/vendor/github.com/google/go-github/v66/github/pulls.go @@ -8,7 +8,6 @@ package github import ( "bytes" "context" - "errors" "fmt" ) @@ -353,7 +352,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, errors.New("pull must be provided") + return nil, nil, fmt.Errorf("pull must be provided") } u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) diff --git a/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go index 9dd60ae68..3f0c50b74 100644 --- a/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go +++ b/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go @@ -23,13 +23,6 @@ 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 @@ -83,21 +76,8 @@ 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, &removeRequest) + req, err := s.client.NewRequest("DELETE", u, &reviewers) if err != nil { return nil, err } diff --git a/vendor/github.com/google/go-github/v66/github/repos.go b/vendor/github.com/google/go-github/v66/github/repos.go index 9faed401f..d928771df 100644 --- a/vendor/github.com/google/go-github/v66/github/repos.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/repos_attestations.go b/vendor/github.com/google/go-github/v66/github/repos_attestations.go deleted file mode 100644 index 2e5425502..000000000 --- a/vendor/github.com/google/go-github/v66/github/repos_attestations.go +++ /dev/null @@ -1,39 +0,0 @@ -// 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/vendor/github.com/google/go-github/v66/github/repos_contents.go b/vendor/github.com/google/go-github/v66/github/repos_contents.go index 3a0c266b5..97539aeeb 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/repos_deployments.go b/vendor/github.com/google/go-github/v66/github/repos_deployments.go index 6277ac215..d8c0b6321 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/repos_invitations.go b/vendor/github.com/google/go-github/v66/github/repos_invitations.go index 98fe01d1c..4922e0b29 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/v66/github/repos_invitations.go @@ -23,7 +23,6 @@ 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. diff --git a/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go index 8bac8bff7..7d85c8736 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v66/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.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.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.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.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.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.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.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/vendor/github.com/google/go-github/v66/github/repos_rules.go b/vendor/github.com/google/go-github/v66/github/repos_rules.go index 0d5052a4b..d09bb71d1 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_rules.go +++ b/vendor/github.com/google/go-github/v66/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,omitempty"` + Source string `json:"source"` } // RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. @@ -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,omitempty"` + DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create"` RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` } @@ -155,20 +155,7 @@ type RuleRequiredWorkflow struct { // 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"` + RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` } // RepositoryRule represents a GitHub Rule. @@ -180,226 +167,6 @@ 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 { @@ -503,15 +270,6 @@ 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{} @@ -726,18 +484,6 @@ 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) @@ -802,8 +548,6 @@ 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/vendor/github.com/google/go-github/v66/github/repos_tags.go b/vendor/github.com/google/go-github/v66/github/repos_tags.go index 3fb7f583d..93164dd1b 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v66/github/repos_tags.go @@ -22,10 +22,9 @@ type tagProtectionRequest struct { Pattern string `json:"pattern"` } -// 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 +// ListTagProtection lists tag protection of the specified repository. // -// 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#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) { @@ -45,10 +44,9 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo return tagProtections, resp, nil } -// 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 +// CreateTagProtection creates the tag protection of the specified repository. // -// 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#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) { @@ -68,10 +66,9 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re return tagProtection, resp, nil } -// 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 +// DeleteTagProtection deletes a tag protection from the specified repository. // -// 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#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/vendor/github.com/google/go-github/v66/github/search.go b/vendor/github.com/google/go-github/v66/github/search.go index 54bc6d5e1..71efe87a0 100644 --- a/vendor/github.com/google/go-github/v66/github/search.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/teams.go b/vendor/github.com/google/go-github/v66/github/teams.go index df248b654..10dbebcbb 100644 --- a/vendor/github.com/google/go-github/v66/github/teams.go +++ b/vendor/github.com/google/go-github/v66/github/teams.go @@ -9,6 +9,7 @@ import ( "context" "fmt" "net/http" + "strings" ) // TeamsService provides access to the team-related functions @@ -388,7 +389,8 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 } // TODO: remove custom Accept header when topics API fully launches. - req.Header.Set("Accept", mediaTypeTopicsPreview) + headers := []string{mediaTypeTopicsPreview} + req.Header.Set("Accept", strings.Join(headers, ", ")) var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) @@ -417,7 +419,8 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string } // TODO: remove custom Accept header when topics API fully launches. - req.Header.Set("Accept", mediaTypeTopicsPreview) + headers := []string{mediaTypeTopicsPreview} + req.Header.Set("Accept", strings.Join(headers, ", ")) var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) @@ -442,7 +445,8 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, return nil, nil, err } - req.Header.Set("Accept", mediaTypeOrgPermissionRepo) + headers := []string{mediaTypeOrgPermissionRepo} + req.Header.Set("Accept", strings.Join(headers, ", ")) repository := new(Repository) resp, err := s.client.Do(ctx, req, repository) @@ -467,7 +471,8 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r return nil, nil, err } - req.Header.Set("Accept", mediaTypeOrgPermissionRepo) + headers := []string{mediaTypeOrgPermissionRepo} + req.Header.Set("Accept", strings.Join(headers, ", ")) repository := new(Repository) resp, err := s.client.Do(ctx, req, repository) @@ -601,7 +606,8 @@ 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) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -626,7 +632,8 @@ 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) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -651,7 +658,8 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID } // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) projects := &Project{} resp, err := s.client.Do(ctx, req, &projects) @@ -676,7 +684,8 @@ 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) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) projects := &Project{} resp, err := s.client.Do(ctx, req, &projects) @@ -714,7 +723,8 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr } // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) return s.client.Do(ctx, req, nil) } @@ -734,7 +744,8 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin } // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) return s.client.Do(ctx, req, nil) } @@ -757,7 +768,8 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, } // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) return s.client.Do(ctx, req, nil) } @@ -780,7 +792,8 @@ func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug st } // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) + acceptHeaders := []string{mediaTypeProjectsPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v66/github/timestamp.go b/vendor/github.com/google/go-github/v66/github/timestamp.go index dc1045cf7..00c1235e9 100644 --- a/vendor/github.com/google/go-github/v66/github/timestamp.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/users.go b/vendor/github.com/google/go-github/v66/github/users.go index c1ab55524..51b2b2193 100644 --- a/vendor/github.com/google/go-github/v66/github/users.go +++ b/vendor/github.com/google/go-github/v66/github/users.go @@ -107,9 +107,9 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user-using-their-id +// Note: GetByID uses the undocumented GitHub API endpoint "GET /user/{user_id}". // -//meta:operation GET /user/{account_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) diff --git a/vendor/github.com/google/go-github/v66/github/users_administration.go b/vendor/github.com/google/go-github/v66/github/users_administration.go index 6b74da5fe..2c86af733 100644 --- a/vendor/github.com/google/go-github/v66/github/users_administration.go +++ b/vendor/github.com/google/go-github/v66/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.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.14/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.14/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.14/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/vendor/github.com/google/go-github/v66/github/users_attestations.go b/vendor/github.com/google/go-github/v66/github/users_attestations.go deleted file mode 100644 index 18f60298d..000000000 --- a/vendor/github.com/google/go-github/v66/github/users_attestations.go +++ /dev/null @@ -1,40 +0,0 @@ -// 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/vendor/github.com/google/go-github/v66/github/users_emails.go b/vendor/github.com/google/go-github/v66/github/users_emails.go index 3d0e1bfaa..189187a74 100644 --- a/vendor/github.com/google/go-github/v66/github/users_emails.go +++ b/vendor/github.com/google/go-github/v66/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/vendor/github.com/google/go-github/v66/github/with_appengine.go b/vendor/github.com/google/go-github/v66/github/with_appengine.go index 9bb95b8c8..9053ce105 100644 --- a/vendor/github.com/google/go-github/v66/github/with_appengine.go +++ b/vendor/github.com/google/go-github/v66/github/with_appengine.go @@ -4,6 +4,7 @@ // 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/vendor/github.com/google/go-github/v66/github/without_appengine.go b/vendor/github.com/google/go-github/v66/github/without_appengine.go index bfdb18ecb..0024ae415 100644 --- a/vendor/github.com/google/go-github/v66/github/without_appengine.go +++ b/vendor/github.com/google/go-github/v66/github/without_appengine.go @@ -4,6 +4,7 @@ // 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/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go index 91198f819..c93695403 100644 --- a/vendor/github.com/google/go-querystring/query/encode.go +++ b/vendor/github.com/google/go-querystring/query/encode.go @@ -6,22 +6,21 @@ // // As a simple example: // -// type Options struct { -// Query string `url:"q"` -// ShowAll bool `url:"all"` -// Page int `url:"page"` -// } +// type Options struct { +// Query string `url:"q"` +// ShowAll bool `url:"all"` +// Page int `url:"page"` +// } // -// opt := Options{ "foo", true, 2 } -// v, _ := query.Values(opt) -// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" +// opt := Options{ "foo", true, 2 } +// v, _ := query.Values(opt) +// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" // // The exact mapping between Go values and url.Values is described in the // documentation for the Values() function. package query import ( - "bytes" "fmt" "net/url" "reflect" @@ -47,8 +46,8 @@ type Encoder interface { // // Each exported struct field is encoded as a URL parameter unless // -// - the field's tag is "-", or -// - the field is empty and its tag specifies the "omitempty" option +// - the field's tag is "-", or +// - the field is empty and its tag specifies the "omitempty" option // // The empty values are false, 0, any nil pointer or interface value, any array // slice, map, or string of length zero, and any type (such as time.Time) that @@ -59,19 +58,19 @@ type Encoder interface { // field's tag value is the key name, followed by an optional comma and // options. For example: // -// // Field is ignored by this package. -// Field int `url:"-"` +// // Field is ignored by this package. +// Field int `url:"-"` // -// // Field appears as URL parameter "myName". -// Field int `url:"myName"` +// // Field appears as URL parameter "myName". +// Field int `url:"myName"` // -// // Field appears as URL parameter "myName" and the field is omitted if -// // its value is empty -// Field int `url:"myName,omitempty"` +// // Field appears as URL parameter "myName" and the field is omitted if +// // its value is empty +// Field int `url:"myName,omitempty"` // -// // Field appears as URL parameter "Field" (the default), but the field -// // is skipped if empty. Note the leading comma. -// Field int `url:",omitempty"` +// // Field appears as URL parameter "Field" (the default), but the field +// // is skipped if empty. Note the leading comma. +// Field int `url:",omitempty"` // // For encoding individual field values, the following type-dependent rules // apply: @@ -88,8 +87,8 @@ type Encoder interface { // "url" tag) will use the value of the "layout" tag as a layout passed to // time.Format. For example: // -// // Encode a time.Time as YYYY-MM-DD -// Field time.Time `layout:"2006-01-02"` +// // Encode a time.Time as YYYY-MM-DD +// Field time.Time `layout:"2006-01-02"` // // Slice and Array values default to encoding as multiple URL values of the // same name. Including the "comma" option signals that the field should be @@ -103,9 +102,9 @@ type Encoder interface { // from the "url" tag) will use the value of the "del" tag as the delimiter. // For example: // -// // Encode a slice of bools as ints ("1" for true, "0" for false), -// // separated by exclamation points "!". -// Field []bool `url:",int" del:"!"` +// // Encode a slice of bools as ints ("1" for true, "0" for false), +// // separated by exclamation points "!". +// Field []bool `url:",int" del:"!"` // // Anonymous struct fields are usually encoded as if their inner exported // fields were fields in the outer struct, subject to the standard Go @@ -114,10 +113,10 @@ type Encoder interface { // // Non-nil pointer values are encoded as the value pointed to. // -// Nested structs are encoded including parent fields in value names for -// scoping. e.g: +// Nested structs have their fields processed recursively and are encoded +// including parent fields in value names for scoping. For example, // -// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" +// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" // // All other values are encoded using their default string representation. // @@ -125,6 +124,11 @@ type Encoder interface { // as multiple URL values of the same name. func Values(v interface{}) (url.Values, error) { values := make(url.Values) + + if v == nil { + return values, nil + } + val := reflect.ValueOf(v) for val.Kind() == reflect.Ptr { if val.IsNil() { @@ -133,10 +137,6 @@ func Values(v interface{}) (url.Values, error) { val = val.Elem() } - if v == nil { - return values, nil - } - if val.Kind() != reflect.Struct { return nil, fmt.Errorf("query: Values() expects struct input. Got %v", val.Kind()) } @@ -209,6 +209,11 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } if sv.Kind() == reflect.Slice || sv.Kind() == reflect.Array { + if sv.Len() == 0 { + // skip if slice or array is empty + continue + } + var del string if opts.Contains("comma") { del = "," @@ -223,7 +228,7 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } if del != "" { - s := new(bytes.Buffer) + s := new(strings.Builder) first := true for i := 0; i < sv.Len(); i++ { if first { diff --git a/vendor/modules.txt b/vendor/modules.txt index 71cda86f5..8222c8476 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -433,18 +433,20 @@ github.com/golangci/revgrep # github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed ## explicit; go 1.20 github.com/golangci/unconvert -# github.com/google/go-cmp v0.6.0 -## explicit; go 1.13 +# github.com/google/go-cmp v0.7.0 +## explicit; go 1.21 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 +# github.com/google/go-github/v66 v66.0.0 ## explicit; go 1.21 github.com/google/go-github/v66/github -# github.com/google/go-querystring v1.1.0 -## explicit; go 1.10 +# github.com/google/go-github/v82 v82.0.0 +## explicit; go 1.24.0 +# github.com/google/go-querystring v1.2.0 +## explicit; go 1.13 github.com/google/go-querystring/query # github.com/google/uuid v1.6.0 ## explicit