Update go modules
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
829db87f15
commit
c61b7fd268
698 changed files with 69376 additions and 29461 deletions
31
vendor/github.com/google/go-github/v48/github/actions_runner_groups.go
generated
vendored
31
vendor/github.com/google/go-github/v48/github/actions_runner_groups.go
generated
vendored
|
|
@ -12,14 +12,17 @@ import (
|
|||
|
||||
// RunnerGroup represents a self-hosted runner group configured in an organization.
|
||||
type RunnerGroup struct {
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
Default *bool `json:"default,omitempty"`
|
||||
SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"`
|
||||
RunnersURL *string `json:"runners_url,omitempty"`
|
||||
Inherited *bool `json:"inherited,omitempty"`
|
||||
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
Default *bool `json:"default,omitempty"`
|
||||
SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"`
|
||||
RunnersURL *string `json:"runners_url,omitempty"`
|
||||
Inherited *bool `json:"inherited,omitempty"`
|
||||
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
|
||||
RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"`
|
||||
SelectedWorkflows []string `json:"selected_workflows,omitempty"`
|
||||
WorkflowRestrictionsReadOnly *bool `json:"workflow_restrictions_read_only,omitempty"`
|
||||
}
|
||||
|
||||
// RunnerGroups represents a collection of self-hosted runner groups configured for an organization.
|
||||
|
|
@ -38,13 +41,19 @@ type CreateRunnerGroupRequest struct {
|
|||
Runners []int64 `json:"runners,omitempty"`
|
||||
// If set to True, public repos can use this runner group
|
||||
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
|
||||
// If true, the runner group will be restricted to running only the workflows specified in the SelectedWorkflows slice.
|
||||
RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"`
|
||||
// List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true.
|
||||
SelectedWorkflows []string `json:"selected_workflows,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateRunnerGroupRequest represents a request to update a Runner group for an organization.
|
||||
type UpdateRunnerGroupRequest struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"`
|
||||
RestrictedToWorkflows *bool `json:"restricted_to_workflows,omitempty"`
|
||||
SelectedWorkflows []string `json:"selected_workflows,omitempty"`
|
||||
}
|
||||
|
||||
// SetRepoAccessRunnerGroupRequest represents a request to replace the list of repositories
|
||||
|
|
|
|||
1
vendor/github.com/google/go-github/v48/github/actions_workflow_jobs.go
generated
vendored
1
vendor/github.com/google/go-github/v48/github/actions_workflow_jobs.go
generated
vendored
|
|
@ -44,6 +44,7 @@ type WorkflowJob struct {
|
|||
RunnerName *string `json:"runner_name,omitempty"`
|
||||
RunnerGroupID *int64 `json:"runner_group_id,omitempty"`
|
||||
RunnerGroupName *string `json:"runner_group_name,omitempty"`
|
||||
RunAttempt *int64 `json:"run_attempt,omitempty"`
|
||||
}
|
||||
|
||||
// Jobs represents a slice of repository action workflow job.
|
||||
|
|
|
|||
5
vendor/github.com/google/go-github/v48/github/code-scanning.go
generated
vendored
5
vendor/github.com/google/go-github/v48/github/code-scanning.go
generated
vendored
|
|
@ -87,6 +87,7 @@ type Alert struct {
|
|||
DismissedBy *User `json:"dismissed_by,omitempty"`
|
||||
DismissedAt *Timestamp `json:"dismissed_at,omitempty"`
|
||||
DismissedReason *string `json:"dismissed_reason,omitempty"`
|
||||
DismissedComment *string `json:"dismissed_comment,omitempty"`
|
||||
InstancesURL *string `json:"instances_url,omitempty"`
|
||||
}
|
||||
|
||||
|
|
@ -121,6 +122,10 @@ type AlertListOptions struct {
|
|||
// Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/<branch name>.
|
||||
Ref string `url:"ref,omitempty"`
|
||||
|
||||
ListCursorOptions
|
||||
|
||||
// Add ListOptions so offset pagination with integer type "page" query parameter is accepted
|
||||
// since ListCursorOptions accepts "page" as string only.
|
||||
ListOptions
|
||||
}
|
||||
|
||||
|
|
|
|||
134
vendor/github.com/google/go-github/v48/github/dependabot_alerts.go
generated
vendored
Normal file
134
vendor/github.com/google/go-github/v48/github/dependabot_alerts.go
generated
vendored
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
// Copyright 2022 The go-github AUTHORS. All rights reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Dependency reprensents the vulnerable dependency.
|
||||
type Dependency struct {
|
||||
Package *VulnerabilityPackage `json:"package,omitempty"`
|
||||
ManifestPath *string `json:"manifest_path,omitempty"`
|
||||
Scope *string `json:"scope,omitempty"`
|
||||
}
|
||||
|
||||
// AdvisoryCVSs represents the advisory pertaining to the Common Vulnerability Scoring System.
|
||||
type AdvisoryCVSs struct {
|
||||
Score *float64 `json:"score,omitempty"`
|
||||
VectorString *string `json:"vector_string,omitempty"`
|
||||
}
|
||||
|
||||
// AdvisoryCWEs reprensent the advisory pertaining to Common Weakness Enumeration.
|
||||
type AdvisoryCWEs struct {
|
||||
CWEID *string `json:"cwe_id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// DependabotSecurityAdvisory represents the GitHub Security Advisory.
|
||||
type DependabotSecurityAdvisory struct {
|
||||
GHSAID *string `json:"ghsa_id,omitempty"`
|
||||
CVEID *string `json:"cve_id,omitempty"`
|
||||
Summary *string `json:"summary,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"`
|
||||
Severity *string `json:"severity,omitempty"`
|
||||
CVSs *AdvisoryCVSs `json:"cvss,omitempty"`
|
||||
CWEs []*AdvisoryCWEs `json:"cwes,omitempty"`
|
||||
Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"`
|
||||
References []*AdvisoryReference `json:"references,omitempty"`
|
||||
PublishedAt *Timestamp `json:"published_at,omitempty"`
|
||||
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
|
||||
WithdrawnAt *Timestamp `json:"withdrawn_at,omitempty"`
|
||||
}
|
||||
|
||||
// DependabotAlert represents a Dependabot alert.
|
||||
type DependabotAlert struct {
|
||||
Number *int `json:"number,omitempty"`
|
||||
State *string `json:"state,omitempty"`
|
||||
Dependency *Dependency `json:"dependency,omitempty"`
|
||||
SecurityAdvisory *DependabotSecurityAdvisory `json:"security_advisory,omitempty"`
|
||||
SecurityVulnerability *AdvisoryVulnerability `json:"security_vulnerability,omitempty"`
|
||||
URL *string `json:"url,omitempty"`
|
||||
HTMLURL *string `json:"html_url,omitempty"`
|
||||
CreatedAt *Timestamp `json:"created_at,omitempty"`
|
||||
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
|
||||
DismissedAt *Timestamp `json:"dismissed_at,omitempty"`
|
||||
DismissedBy *User `json:"dismissed_by,omitempty"`
|
||||
DismissedReason *string `json:"dismissed_reason,omitempty"`
|
||||
DismissedComment *string `json:"dismissed_comment,omitempty"`
|
||||
FixedAt *Timestamp `json:"fixed_at,omitempty"`
|
||||
}
|
||||
|
||||
// ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts
|
||||
// and DependabotService.ListOrgAlerts methods.
|
||||
type ListAlertsOptions struct {
|
||||
State *string `url:"state,omitempty"`
|
||||
Severity *string `url:"severity,omitempty"`
|
||||
Ecosystem *string `url:"ecosystem,omitempty"`
|
||||
Package *string `url:"package,omitempty"`
|
||||
Scope *string `url:"scope,omitempty"`
|
||||
Sort *string `url:"sort,omitempty"`
|
||||
Direction *string `url:"direction,omitempty"`
|
||||
|
||||
ListCursorOptions
|
||||
}
|
||||
|
||||
func (s *DependabotService) listAlerts(ctx context.Context, url string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) {
|
||||
u, err := addOptions(url, opts)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var alerts []*DependabotAlert
|
||||
resp, err := s.client.Do(ctx, req, &alerts)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return alerts, resp, nil
|
||||
}
|
||||
|
||||
// ListRepoAlerts lists all Dependabot alerts of a repository.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository
|
||||
func (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) {
|
||||
url := fmt.Sprintf("repos/%v/%v/dependabot/alerts", owner, repo)
|
||||
return s.listAlerts(ctx, url, opts)
|
||||
}
|
||||
|
||||
// ListOrgAlerts lists all Dependabot alerts of an organization.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization
|
||||
func (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) {
|
||||
url := fmt.Sprintf("orgs/%v/dependabot/alerts", org)
|
||||
return s.listAlerts(ctx, url, opts)
|
||||
}
|
||||
|
||||
// GetRepoAlert gets a single repository Dependabot alert.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/dependabot/alerts#get-a-dependabot-alert
|
||||
func (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) {
|
||||
url := fmt.Sprintf("repos/%v/%v/dependabot/alerts/%v", owner, repo, number)
|
||||
req, err := s.client.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
alert := new(DependabotAlert)
|
||||
resp, err := s.client.Do(ctx, req, alert)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return alert, resp, nil
|
||||
}
|
||||
2
vendor/github.com/google/go-github/v48/github/event.go
generated
vendored
2
vendor/github.com/google/go-github/v48/github/event.go
generated
vendored
|
|
@ -76,6 +76,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) {
|
|||
payload = &MemberEvent{}
|
||||
case "MembershipEvent":
|
||||
payload = &MembershipEvent{}
|
||||
case "MergeGroupEvent":
|
||||
payload = &MergeGroupEvent{}
|
||||
case "MetaEvent":
|
||||
payload = &MetaEvent{}
|
||||
case "MilestoneEvent":
|
||||
|
|
|
|||
31
vendor/github.com/google/go-github/v48/github/event_types.go
generated
vendored
31
vendor/github.com/google/go-github/v48/github/event_types.go
generated
vendored
|
|
@ -559,6 +559,37 @@ type MembershipEvent struct {
|
|||
Installation *Installation `json:"installation,omitempty"`
|
||||
}
|
||||
|
||||
// MergeGroup represents the merge group in a merge queue.
|
||||
type MergeGroup struct {
|
||||
// The SHA of the merge group.
|
||||
HeadSHA *string `json:"head_sha,omitempty"`
|
||||
// The full ref of the merge group.
|
||||
HeadRef *string `json:"head_ref,omitempty"`
|
||||
// The SHA of the merge group's parent commit.
|
||||
BaseSHA *string `json:"base_sha,omitempty"`
|
||||
// The full ref of the branch the merge group will be merged into.
|
||||
BaseRef *string `json:"base_ref,omitempty"`
|
||||
// An expanded representation of the head_sha commit.
|
||||
HeadCommit *Commit `json:"head_commit,omitempty"`
|
||||
}
|
||||
|
||||
// MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified
|
||||
// in the action property of the payload object.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#merge_group
|
||||
type MergeGroupEvent struct {
|
||||
// The action that was performed. Currently, can only be checks_requested.
|
||||
Action *string `json:"action,omitempty"`
|
||||
// The merge group.
|
||||
MergeGroup *MergeGroup `json:"merge_group,omitempty"`
|
||||
|
||||
// The following fields are only populated by Webhook events.
|
||||
Repo *Repository `json:"repository,omitempty"`
|
||||
Org *Organization `json:"organization,omitempty"`
|
||||
Installation *Installation `json:"installation,omitempty"`
|
||||
Sender *User `json:"sender,omitempty"`
|
||||
}
|
||||
|
||||
// MetaEvent is triggered when the webhook that this event is configured on is deleted.
|
||||
// This event will only listen for changes to the particular hook the event is installed on.
|
||||
// Therefore, it must be selected for each hook that you'd like to receive meta events for.
|
||||
|
|
|
|||
496
vendor/github.com/google/go-github/v48/github/github-accessors.go
generated
vendored
496
vendor/github.com/google/go-github/v48/github/github-accessors.go
generated
vendored
|
|
@ -206,6 +206,38 @@ func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string {
|
|||
return *a.UserLogin
|
||||
}
|
||||
|
||||
// GetScore returns the Score field.
|
||||
func (a *AdvisoryCVSs) GetScore() *float64 {
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
return a.Score
|
||||
}
|
||||
|
||||
// GetVectorString returns the VectorString field if it's non-nil, zero value otherwise.
|
||||
func (a *AdvisoryCVSs) GetVectorString() string {
|
||||
if a == nil || a.VectorString == nil {
|
||||
return ""
|
||||
}
|
||||
return *a.VectorString
|
||||
}
|
||||
|
||||
// GetCWEID returns the CWEID field if it's non-nil, zero value otherwise.
|
||||
func (a *AdvisoryCWEs) GetCWEID() string {
|
||||
if a == nil || a.CWEID == nil {
|
||||
return ""
|
||||
}
|
||||
return *a.CWEID
|
||||
}
|
||||
|
||||
// GetName returns the Name field if it's non-nil, zero value otherwise.
|
||||
func (a *AdvisoryCWEs) GetName() string {
|
||||
if a == nil || a.Name == nil {
|
||||
return ""
|
||||
}
|
||||
return *a.Name
|
||||
}
|
||||
|
||||
// GetType returns the Type field if it's non-nil, zero value otherwise.
|
||||
func (a *AdvisoryIdentifier) GetType() string {
|
||||
if a == nil || a.Type == nil {
|
||||
|
|
@ -302,6 +334,14 @@ func (a *Alert) GetDismissedBy() *User {
|
|||
return a.DismissedBy
|
||||
}
|
||||
|
||||
// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.
|
||||
func (a *Alert) GetDismissedComment() string {
|
||||
if a == nil || a.DismissedComment == nil {
|
||||
return ""
|
||||
}
|
||||
return *a.DismissedComment
|
||||
}
|
||||
|
||||
// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.
|
||||
func (a *Alert) GetDismissedReason() string {
|
||||
if a == nil || a.DismissedReason == nil {
|
||||
|
|
@ -3614,6 +3654,14 @@ func (c *CreateRunnerGroupRequest) GetName() string {
|
|||
return *c.Name
|
||||
}
|
||||
|
||||
// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.
|
||||
func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool {
|
||||
if c == nil || c.RestrictedToWorkflows == nil {
|
||||
return false
|
||||
}
|
||||
return *c.RestrictedToWorkflows
|
||||
}
|
||||
|
||||
// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.
|
||||
func (c *CreateRunnerGroupRequest) GetVisibility() string {
|
||||
if c == nil || c.Visibility == nil {
|
||||
|
|
@ -3726,6 +3774,214 @@ func (d *DeleteEvent) GetSender() *User {
|
|||
return d.Sender
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetCreatedAt() Timestamp {
|
||||
if d == nil || d.CreatedAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.CreatedAt
|
||||
}
|
||||
|
||||
// GetDependency returns the Dependency field.
|
||||
func (d *DependabotAlert) GetDependency() *Dependency {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.Dependency
|
||||
}
|
||||
|
||||
// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetDismissedAt() Timestamp {
|
||||
if d == nil || d.DismissedAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.DismissedAt
|
||||
}
|
||||
|
||||
// GetDismissedBy returns the DismissedBy field.
|
||||
func (d *DependabotAlert) GetDismissedBy() *User {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.DismissedBy
|
||||
}
|
||||
|
||||
// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetDismissedComment() string {
|
||||
if d == nil || d.DismissedComment == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.DismissedComment
|
||||
}
|
||||
|
||||
// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetDismissedReason() string {
|
||||
if d == nil || d.DismissedReason == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.DismissedReason
|
||||
}
|
||||
|
||||
// GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetFixedAt() Timestamp {
|
||||
if d == nil || d.FixedAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.FixedAt
|
||||
}
|
||||
|
||||
// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetHTMLURL() string {
|
||||
if d == nil || d.HTMLURL == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.HTMLURL
|
||||
}
|
||||
|
||||
// GetNumber returns the Number field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetNumber() int {
|
||||
if d == nil || d.Number == nil {
|
||||
return 0
|
||||
}
|
||||
return *d.Number
|
||||
}
|
||||
|
||||
// GetSecurityAdvisory returns the SecurityAdvisory field.
|
||||
func (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.SecurityAdvisory
|
||||
}
|
||||
|
||||
// GetSecurityVulnerability returns the SecurityVulnerability field.
|
||||
func (d *DependabotAlert) GetSecurityVulnerability() *AdvisoryVulnerability {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.SecurityVulnerability
|
||||
}
|
||||
|
||||
// GetState returns the State field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetState() string {
|
||||
if d == nil || d.State == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.State
|
||||
}
|
||||
|
||||
// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetUpdatedAt() Timestamp {
|
||||
if d == nil || d.UpdatedAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.UpdatedAt
|
||||
}
|
||||
|
||||
// GetURL returns the URL field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotAlert) GetURL() string {
|
||||
if d == nil || d.URL == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.URL
|
||||
}
|
||||
|
||||
// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetCVEID() string {
|
||||
if d == nil || d.CVEID == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.CVEID
|
||||
}
|
||||
|
||||
// GetCVSs returns the CVSs field.
|
||||
func (d *DependabotSecurityAdvisory) GetCVSs() *AdvisoryCVSs {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.CVSs
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetDescription() string {
|
||||
if d == nil || d.Description == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.Description
|
||||
}
|
||||
|
||||
// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetGHSAID() string {
|
||||
if d == nil || d.GHSAID == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.GHSAID
|
||||
}
|
||||
|
||||
// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp {
|
||||
if d == nil || d.PublishedAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.PublishedAt
|
||||
}
|
||||
|
||||
// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetSeverity() string {
|
||||
if d == nil || d.Severity == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.Severity
|
||||
}
|
||||
|
||||
// GetSummary returns the Summary field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetSummary() string {
|
||||
if d == nil || d.Summary == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.Summary
|
||||
}
|
||||
|
||||
// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp {
|
||||
if d == nil || d.UpdatedAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.UpdatedAt
|
||||
}
|
||||
|
||||
// GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise.
|
||||
func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp {
|
||||
if d == nil || d.WithdrawnAt == nil {
|
||||
return Timestamp{}
|
||||
}
|
||||
return *d.WithdrawnAt
|
||||
}
|
||||
|
||||
// GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise.
|
||||
func (d *Dependency) GetManifestPath() string {
|
||||
if d == nil || d.ManifestPath == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.ManifestPath
|
||||
}
|
||||
|
||||
// GetPackage returns the Package field.
|
||||
func (d *Dependency) GetPackage() *VulnerabilityPackage {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return d.Package
|
||||
}
|
||||
|
||||
// GetScope returns the Scope field if it's non-nil, zero value otherwise.
|
||||
func (d *Dependency) GetScope() string {
|
||||
if d == nil || d.Scope == nil {
|
||||
return ""
|
||||
}
|
||||
return *d.Scope
|
||||
}
|
||||
|
||||
// GetAction returns the Action field if it's non-nil, zero value otherwise.
|
||||
func (d *DeployKeyEvent) GetAction() string {
|
||||
if d == nil || d.Action == nil {
|
||||
|
|
@ -4558,6 +4814,14 @@ func (d *DiscussionEvent) GetSender() *User {
|
|||
return d.Sender
|
||||
}
|
||||
|
||||
// GetApps returns the Apps field if it's non-nil, zero value otherwise.
|
||||
func (d *DismissalRestrictionsRequest) GetApps() []string {
|
||||
if d == nil || d.Apps == nil {
|
||||
return nil
|
||||
}
|
||||
return *d.Apps
|
||||
}
|
||||
|
||||
// GetTeams returns the Teams field if it's non-nil, zero value otherwise.
|
||||
func (d *DismissalRestrictionsRequest) GetTeams() []string {
|
||||
if d == nil || d.Teams == nil {
|
||||
|
|
@ -7206,6 +7470,14 @@ func (i *Issue) GetState() string {
|
|||
return *i.State
|
||||
}
|
||||
|
||||
// GetStateReason returns the StateReason field if it's non-nil, zero value otherwise.
|
||||
func (i *Issue) GetStateReason() string {
|
||||
if i == nil || i.StateReason == nil {
|
||||
return ""
|
||||
}
|
||||
return *i.StateReason
|
||||
}
|
||||
|
||||
// GetTitle returns the Title field if it's non-nil, zero value otherwise.
|
||||
func (i *Issue) GetTitle() string {
|
||||
if i == nil || i.Title == nil {
|
||||
|
|
@ -8262,6 +8534,62 @@ func (l *LinearHistoryRequirementEnforcementLevelChanges) GetFrom() string {
|
|||
return *l.From
|
||||
}
|
||||
|
||||
// GetDirection returns the Direction field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetDirection() string {
|
||||
if l == nil || l.Direction == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.Direction
|
||||
}
|
||||
|
||||
// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetEcosystem() string {
|
||||
if l == nil || l.Ecosystem == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.Ecosystem
|
||||
}
|
||||
|
||||
// GetPackage returns the Package field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetPackage() string {
|
||||
if l == nil || l.Package == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.Package
|
||||
}
|
||||
|
||||
// GetScope returns the Scope field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetScope() string {
|
||||
if l == nil || l.Scope == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.Scope
|
||||
}
|
||||
|
||||
// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetSeverity() string {
|
||||
if l == nil || l.Severity == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.Severity
|
||||
}
|
||||
|
||||
// GetSort returns the Sort field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetSort() string {
|
||||
if l == nil || l.Sort == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.Sort
|
||||
}
|
||||
|
||||
// GetState returns the State field if it's non-nil, zero value otherwise.
|
||||
func (l *ListAlertsOptions) GetState() string {
|
||||
if l == nil || l.State == nil {
|
||||
return ""
|
||||
}
|
||||
return *l.State
|
||||
}
|
||||
|
||||
// GetAppID returns the AppID field if it's non-nil, zero value otherwise.
|
||||
func (l *ListCheckRunsOptions) GetAppID() int64 {
|
||||
if l == nil || l.AppID == nil {
|
||||
|
|
@ -8862,6 +9190,94 @@ func (m *MembershipEvent) GetTeam() *Team {
|
|||
return m.Team
|
||||
}
|
||||
|
||||
// GetBaseRef returns the BaseRef field if it's non-nil, zero value otherwise.
|
||||
func (m *MergeGroup) GetBaseRef() string {
|
||||
if m == nil || m.BaseRef == nil {
|
||||
return ""
|
||||
}
|
||||
return *m.BaseRef
|
||||
}
|
||||
|
||||
// GetBaseSHA returns the BaseSHA field if it's non-nil, zero value otherwise.
|
||||
func (m *MergeGroup) GetBaseSHA() string {
|
||||
if m == nil || m.BaseSHA == nil {
|
||||
return ""
|
||||
}
|
||||
return *m.BaseSHA
|
||||
}
|
||||
|
||||
// GetHeadCommit returns the HeadCommit field.
|
||||
func (m *MergeGroup) GetHeadCommit() *Commit {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
return m.HeadCommit
|
||||
}
|
||||
|
||||
// GetHeadRef returns the HeadRef field if it's non-nil, zero value otherwise.
|
||||
func (m *MergeGroup) GetHeadRef() string {
|
||||
if m == nil || m.HeadRef == nil {
|
||||
return ""
|
||||
}
|
||||
return *m.HeadRef
|
||||
}
|
||||
|
||||
// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.
|
||||
func (m *MergeGroup) GetHeadSHA() string {
|
||||
if m == nil || m.HeadSHA == nil {
|
||||
return ""
|
||||
}
|
||||
return *m.HeadSHA
|
||||
}
|
||||
|
||||
// GetAction returns the Action field if it's non-nil, zero value otherwise.
|
||||
func (m *MergeGroupEvent) GetAction() string {
|
||||
if m == nil || m.Action == nil {
|
||||
return ""
|
||||
}
|
||||
return *m.Action
|
||||
}
|
||||
|
||||
// GetInstallation returns the Installation field.
|
||||
func (m *MergeGroupEvent) GetInstallation() *Installation {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
return m.Installation
|
||||
}
|
||||
|
||||
// GetMergeGroup returns the MergeGroup field.
|
||||
func (m *MergeGroupEvent) GetMergeGroup() *MergeGroup {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
return m.MergeGroup
|
||||
}
|
||||
|
||||
// GetOrg returns the Org field.
|
||||
func (m *MergeGroupEvent) GetOrg() *Organization {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
return m.Org
|
||||
}
|
||||
|
||||
// GetRepo returns the Repo field.
|
||||
func (m *MergeGroupEvent) GetRepo() *Repository {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
return m.Repo
|
||||
}
|
||||
|
||||
// GetSender returns the Sender field.
|
||||
func (m *MergeGroupEvent) GetSender() *User {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
return m.Sender
|
||||
}
|
||||
|
||||
// GetText returns the Text field if it's non-nil, zero value otherwise.
|
||||
func (m *Message) GetText() string {
|
||||
if m == nil || m.Text == nil {
|
||||
|
|
@ -11846,6 +12262,14 @@ func (p *Protection) GetAllowForcePushes() *AllowForcePushes {
|
|||
return p.AllowForcePushes
|
||||
}
|
||||
|
||||
// GetAllowForkSyncing returns the AllowForkSyncing field if it's non-nil, zero value otherwise.
|
||||
func (p *Protection) GetAllowForkSyncing() bool {
|
||||
if p == nil || p.AllowForkSyncing == nil {
|
||||
return false
|
||||
}
|
||||
return *p.AllowForkSyncing
|
||||
}
|
||||
|
||||
// GetEnforceAdmins returns the EnforceAdmins field.
|
||||
func (p *Protection) GetEnforceAdmins() *AdminEnforcement {
|
||||
if p == nil {
|
||||
|
|
@ -11854,6 +12278,14 @@ func (p *Protection) GetEnforceAdmins() *AdminEnforcement {
|
|||
return p.EnforceAdmins
|
||||
}
|
||||
|
||||
// GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise.
|
||||
func (p *Protection) GetLockBranch() bool {
|
||||
if p == nil || p.LockBranch == nil {
|
||||
return false
|
||||
}
|
||||
return *p.LockBranch
|
||||
}
|
||||
|
||||
// GetRequiredConversationResolution returns the RequiredConversationResolution field.
|
||||
func (p *Protection) GetRequiredConversationResolution() *RequiredConversationResolution {
|
||||
if p == nil {
|
||||
|
|
@ -13262,6 +13694,14 @@ func (p *PullRequestReviewsEnforcementUpdate) GetRequireCodeOwnerReviews() bool
|
|||
return *p.RequireCodeOwnerReviews
|
||||
}
|
||||
|
||||
// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise.
|
||||
func (p *PullRequestReviewsEnforcementUpdate) GetRequireLastPushApproval() bool {
|
||||
if p == nil || p.RequireLastPushApproval == nil {
|
||||
return false
|
||||
}
|
||||
return *p.RequireLastPushApproval
|
||||
}
|
||||
|
||||
// GetAction returns the Action field if it's non-nil, zero value otherwise.
|
||||
func (p *PullRequestReviewThreadEvent) GetAction() string {
|
||||
if p == nil || p.Action == nil {
|
||||
|
|
@ -14718,6 +15158,14 @@ func (r *Repository) GetGitURL() string {
|
|||
return *r.GitURL
|
||||
}
|
||||
|
||||
// GetHasDiscussions returns the HasDiscussions field if it's non-nil, zero value otherwise.
|
||||
func (r *Repository) GetHasDiscussions() bool {
|
||||
if r == nil || r.HasDiscussions == nil {
|
||||
return false
|
||||
}
|
||||
return *r.HasDiscussions
|
||||
}
|
||||
|
||||
// GetHasDownloads returns the HasDownloads field if it's non-nil, zero value otherwise.
|
||||
func (r *Repository) GetHasDownloads() bool {
|
||||
if r == nil || r.HasDownloads == nil {
|
||||
|
|
@ -15230,6 +15678,14 @@ func (r *Repository) GetWatchersCount() int {
|
|||
return *r.WatchersCount
|
||||
}
|
||||
|
||||
// GetAccessLevel returns the AccessLevel field if it's non-nil, zero value otherwise.
|
||||
func (r *RepositoryActionsAccessLevel) GetAccessLevel() string {
|
||||
if r == nil || r.AccessLevel == nil {
|
||||
return ""
|
||||
}
|
||||
return *r.AccessLevel
|
||||
}
|
||||
|
||||
// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field if it's non-nil, zero value otherwise.
|
||||
func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int {
|
||||
if r == nil || r.AdvancedSecurityCommitters == nil {
|
||||
|
|
@ -15950,6 +16406,14 @@ func (r *RepositoryRelease) GetID() int64 {
|
|||
return *r.ID
|
||||
}
|
||||
|
||||
// GetMakeLatest returns the MakeLatest field if it's non-nil, zero value otherwise.
|
||||
func (r *RepositoryRelease) GetMakeLatest() string {
|
||||
if r == nil || r.MakeLatest == nil {
|
||||
return ""
|
||||
}
|
||||
return *r.MakeLatest
|
||||
}
|
||||
|
||||
// GetName returns the Name field if it's non-nil, zero value otherwise.
|
||||
func (r *RepositoryRelease) GetName() string {
|
||||
if r == nil || r.Name == nil {
|
||||
|
|
@ -16582,6 +17046,14 @@ func (r *RunnerGroup) GetName() string {
|
|||
return *r.Name
|
||||
}
|
||||
|
||||
// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.
|
||||
func (r *RunnerGroup) GetRestrictedToWorkflows() bool {
|
||||
if r == nil || r.RestrictedToWorkflows == nil {
|
||||
return false
|
||||
}
|
||||
return *r.RestrictedToWorkflows
|
||||
}
|
||||
|
||||
// GetRunnersURL returns the RunnersURL field if it's non-nil, zero value otherwise.
|
||||
func (r *RunnerGroup) GetRunnersURL() string {
|
||||
if r == nil || r.RunnersURL == nil {
|
||||
|
|
@ -16606,6 +17078,14 @@ func (r *RunnerGroup) GetVisibility() string {
|
|||
return *r.Visibility
|
||||
}
|
||||
|
||||
// GetWorkflowRestrictionsReadOnly returns the WorkflowRestrictionsReadOnly field if it's non-nil, zero value otherwise.
|
||||
func (r *RunnerGroup) GetWorkflowRestrictionsReadOnly() bool {
|
||||
if r == nil || r.WorkflowRestrictionsReadOnly == nil {
|
||||
return false
|
||||
}
|
||||
return *r.WorkflowRestrictionsReadOnly
|
||||
}
|
||||
|
||||
// GetID returns the ID field if it's non-nil, zero value otherwise.
|
||||
func (r *RunnerLabels) GetID() int64 {
|
||||
if r == nil || r.ID == nil {
|
||||
|
|
@ -19070,6 +19550,14 @@ func (u *UpdateRunnerGroupRequest) GetName() string {
|
|||
return *u.Name
|
||||
}
|
||||
|
||||
// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.
|
||||
func (u *UpdateRunnerGroupRequest) GetRestrictedToWorkflows() bool {
|
||||
if u == nil || u.RestrictedToWorkflows == nil {
|
||||
return false
|
||||
}
|
||||
return *u.RestrictedToWorkflows
|
||||
}
|
||||
|
||||
// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.
|
||||
func (u *UpdateRunnerGroupRequest) GetVisibility() string {
|
||||
if u == nil || u.Visibility == nil {
|
||||
|
|
@ -20166,6 +20654,14 @@ func (w *WorkflowJob) GetNodeID() string {
|
|||
return *w.NodeID
|
||||
}
|
||||
|
||||
// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise.
|
||||
func (w *WorkflowJob) GetRunAttempt() int64 {
|
||||
if w == nil || w.RunAttempt == nil {
|
||||
return 0
|
||||
}
|
||||
return *w.RunAttempt
|
||||
}
|
||||
|
||||
// GetRunID returns the RunID field if it's non-nil, zero value otherwise.
|
||||
func (w *WorkflowJob) GetRunID() int64 {
|
||||
if w == nil || w.RunID == nil {
|
||||
|
|
|
|||
69
vendor/github.com/google/go-github/v48/github/github.go
generated
vendored
69
vendor/github.com/google/go-github/v48/github/github.go
generated
vendored
|
|
@ -15,7 +15,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
|
|
@ -28,12 +27,14 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
Version = "v48.0.0"
|
||||
Version = "v48.2.0"
|
||||
|
||||
defaultBaseURL = "https://api.github.com/"
|
||||
defaultUserAgent = "go-github" + "/" + Version
|
||||
uploadBaseURL = "https://uploads.github.com/"
|
||||
defaultAPIVersion = "2022-11-28"
|
||||
defaultBaseURL = "https://api.github.com/"
|
||||
defaultUserAgent = "go-github" + "/" + Version
|
||||
uploadBaseURL = "https://uploads.github.com/"
|
||||
|
||||
headerAPIVersion = "X-GitHub-Api-Version"
|
||||
headerRateLimit = "X-RateLimit-Limit"
|
||||
headerRateRemaining = "X-RateLimit-Remaining"
|
||||
headerRateReset = "X-RateLimit-Reset"
|
||||
|
|
@ -237,6 +238,14 @@ type ListCursorOptions struct {
|
|||
// For paginated result sets, the number of results to include per page.
|
||||
PerPage int `url:"per_page,omitempty"`
|
||||
|
||||
// For paginated result sets, the number of results per page (max 100), starting from the first matching result.
|
||||
// This parameter must not be used in combination with last.
|
||||
First int `url:"first,omitempty"`
|
||||
|
||||
// For paginated result sets, the number of results per page (max 100), starting from the last matching result.
|
||||
// This parameter must not be used in combination with first.
|
||||
Last int `url:"last,omitempty"`
|
||||
|
||||
// A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.
|
||||
After string `url:"after,omitempty"`
|
||||
|
||||
|
|
@ -385,12 +394,24 @@ func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*C
|
|||
return c, nil
|
||||
}
|
||||
|
||||
// RequestOption represents an option that can modify an http.Request.
|
||||
type RequestOption func(req *http.Request)
|
||||
|
||||
// WithVersion overrides the GitHub v3 API version for this individual request.
|
||||
// For more information, see:
|
||||
// https://github.blog/2022-11-28-to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/
|
||||
func WithVersion(version string) RequestOption {
|
||||
return func(req *http.Request) {
|
||||
req.Header.Set(headerAPIVersion, version)
|
||||
}
|
||||
}
|
||||
|
||||
// NewRequest creates an API request. A relative URL can be provided in urlStr,
|
||||
// in which case it is resolved relative to the BaseURL of the Client.
|
||||
// Relative URLs should always be specified without a preceding slash. If
|
||||
// specified, the value pointed to by body is JSON encoded and included as the
|
||||
// request body.
|
||||
func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) {
|
||||
func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...RequestOption) (*http.Request, error) {
|
||||
if !strings.HasSuffix(c.BaseURL.Path, "/") {
|
||||
return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL)
|
||||
}
|
||||
|
|
@ -423,6 +444,12 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
|
|||
if c.UserAgent != "" {
|
||||
req.Header.Set("User-Agent", c.UserAgent)
|
||||
}
|
||||
req.Header.Set(headerAPIVersion, defaultAPIVersion)
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(req)
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -430,7 +457,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
|
|||
// in which case it is resolved relative to the BaseURL of the Client.
|
||||
// Relative URLs should always be specified without a preceding slash.
|
||||
// Body is sent with Content-Type: application/x-www-form-urlencoded.
|
||||
func (c *Client) NewFormRequest(urlStr string, body io.Reader) (*http.Request, error) {
|
||||
func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) {
|
||||
if !strings.HasSuffix(c.BaseURL.Path, "/") {
|
||||
return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL)
|
||||
}
|
||||
|
|
@ -450,13 +477,19 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader) (*http.Request, e
|
|||
if c.UserAgent != "" {
|
||||
req.Header.Set("User-Agent", c.UserAgent)
|
||||
}
|
||||
req.Header.Set(headerAPIVersion, defaultAPIVersion)
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(req)
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewUploadRequest creates an upload request. A relative URL can be provided in
|
||||
// urlStr, in which case it is resolved relative to the UploadURL of the Client.
|
||||
// Relative URLs should always be specified without a preceding slash.
|
||||
func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error) {
|
||||
func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) {
|
||||
if !strings.HasSuffix(c.UploadURL.Path, "/") {
|
||||
return nil, fmt.Errorf("UploadURL must have a trailing slash, but %q does not", c.UploadURL)
|
||||
}
|
||||
|
|
@ -478,6 +511,12 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m
|
|||
req.Header.Set("Content-Type", mediaType)
|
||||
req.Header.Set("Accept", mediaTypeV3)
|
||||
req.Header.Set("User-Agent", c.UserAgent)
|
||||
req.Header.Set(headerAPIVersion, defaultAPIVersion)
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(req)
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
|
@ -710,7 +749,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro
|
|||
// Issue #1022
|
||||
aerr, ok := err.(*AcceptedError)
|
||||
if ok {
|
||||
b, readErr := ioutil.ReadAll(resp.Body)
|
||||
b, readErr := io.ReadAll(resp.Body)
|
||||
if readErr != nil {
|
||||
return response, readErr
|
||||
}
|
||||
|
|
@ -770,7 +809,7 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rat
|
|||
StatusCode: http.StatusForbidden,
|
||||
Request: req,
|
||||
Header: make(http.Header),
|
||||
Body: ioutil.NopCloser(strings.NewReader("")),
|
||||
Body: io.NopCloser(strings.NewReader("")),
|
||||
}
|
||||
return &RateLimitError{
|
||||
Rate: rate,
|
||||
|
|
@ -1032,14 +1071,14 @@ func CheckResponse(r *http.Response) error {
|
|||
}
|
||||
|
||||
errorResponse := &ErrorResponse{Response: r}
|
||||
data, err := ioutil.ReadAll(r.Body)
|
||||
data, err := io.ReadAll(r.Body)
|
||||
if err == nil && data != nil {
|
||||
json.Unmarshal(data, errorResponse)
|
||||
}
|
||||
// Re-populate error response body because GitHub error responses are often
|
||||
// undocumented and inconsistent.
|
||||
// Issue #1136, #540.
|
||||
r.Body = ioutil.NopCloser(bytes.NewBuffer(data))
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(data))
|
||||
switch {
|
||||
case r.StatusCode == http.StatusUnauthorized && strings.HasPrefix(r.Header.Get(headerOTP), "required"):
|
||||
return (*TwoFactorAuthError)(errorResponse)
|
||||
|
|
@ -1351,8 +1390,8 @@ func formatRateReset(d time.Duration) string {
|
|||
|
||||
// When using roundTripWithOptionalFollowRedirect, note that it
|
||||
// is the responsibility of the caller to close the response body.
|
||||
func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, followRedirects bool) (*http.Response, error) {
|
||||
req, err := c.NewRequest("GET", u, nil)
|
||||
func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, followRedirects bool, opts ...RequestOption) (*http.Response, error) {
|
||||
req, err := c.NewRequest("GET", u, nil, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1373,7 +1412,7 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri
|
|||
if followRedirects && resp.StatusCode == http.StatusMovedPermanently {
|
||||
resp.Body.Close()
|
||||
u = resp.Header.Get("Location")
|
||||
resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, false)
|
||||
resp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, false, opts...)
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
|
|
|||
8
vendor/github.com/google/go-github/v48/github/issues.go
generated
vendored
8
vendor/github.com/google/go-github/v48/github/issues.go
generated
vendored
|
|
@ -25,9 +25,11 @@ type IssuesService service
|
|||
// this is an issue, and if PullRequestLinks is not nil, this is a pull request.
|
||||
// The IsPullRequest helper method can be used to check that.
|
||||
type Issue struct {
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
Number *int `json:"number,omitempty"`
|
||||
State *string `json:"state,omitempty"`
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
Number *int `json:"number,omitempty"`
|
||||
State *string `json:"state,omitempty"`
|
||||
// StateReason can be one of: "completed", "not_planned", "reopened".
|
||||
StateReason *string `json:"state_reason,omitempty"`
|
||||
Locked *bool `json:"locked,omitempty"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
Body *string `json:"body,omitempty"`
|
||||
|
|
|
|||
2
vendor/github.com/google/go-github/v48/github/issues_timeline.go
generated
vendored
2
vendor/github.com/google/go-github/v48/github/issues_timeline.go
generated
vendored
|
|
@ -35,6 +35,8 @@ type Timeline struct {
|
|||
SHA *string `json:"sha,omitempty"`
|
||||
// The commit message.
|
||||
Message *string `json:"message,omitempty"`
|
||||
// A list of parent commits.
|
||||
Parents []*Commit `json:"parents,omitempty"`
|
||||
|
||||
// Event identifies the actual type of Event that occurred. Possible values
|
||||
// are:
|
||||
|
|
|
|||
6
vendor/github.com/google/go-github/v48/github/messages.go
generated
vendored
6
vendor/github.com/google/go-github/v48/github/messages.go
generated
vendored
|
|
@ -19,7 +19,6 @@ import (
|
|||
"fmt"
|
||||
"hash"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
|
@ -68,6 +67,7 @@ var (
|
|||
"marketplace_purchase": "MarketplacePurchaseEvent",
|
||||
"member": "MemberEvent",
|
||||
"membership": "MembershipEvent",
|
||||
"merge_group": "MergeGroupEvent",
|
||||
"meta": "MetaEvent",
|
||||
"milestone": "MilestoneEvent",
|
||||
"organization": "OrganizationEvent",
|
||||
|
|
@ -170,7 +170,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s
|
|||
switch contentType {
|
||||
case "application/json":
|
||||
var err error
|
||||
if body, err = ioutil.ReadAll(readable); err != nil {
|
||||
if body, err = io.ReadAll(readable); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s
|
|||
const payloadFormParam = "payload"
|
||||
|
||||
var err error
|
||||
if body, err = ioutil.ReadAll(readable); err != nil {
|
||||
if body, err = io.ReadAll(readable); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
|
|||
2
vendor/github.com/google/go-github/v48/github/orgs_packages.go
generated
vendored
2
vendor/github.com/google/go-github/v48/github/orgs_packages.go
generated
vendored
|
|
@ -81,7 +81,7 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT
|
|||
|
||||
// Get all versions of a package in an organization.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/packages#get-all-package-versions-for-a-package-owned-by-an-organization
|
||||
// GitHub API docs: https://docs.github.com/en/rest/packages#list-package-versions-for-a-package-owned-by-an-organization
|
||||
func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) {
|
||||
u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, packageName)
|
||||
u, err := addOptions(u, opts)
|
||||
|
|
|
|||
57
vendor/github.com/google/go-github/v48/github/orgs_security_managers.go
generated
vendored
Normal file
57
vendor/github.com/google/go-github/v48/github/orgs_security_managers.go
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// Copyright 2022 The go-github AUTHORS. All rights reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ListSecurityManagerTeams lists all security manager teams for an organization.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#list-security-manager-teams
|
||||
func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) {
|
||||
u := fmt.Sprintf("orgs/%v/security-managers", org)
|
||||
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var teams []*Team
|
||||
resp, err := s.client.Do(ctx, req, &teams)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return teams, resp, nil
|
||||
}
|
||||
|
||||
// AddSecurityManagerTeam adds a team to the list of security managers for an organization.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#add-a-security-manager-team
|
||||
func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) {
|
||||
u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team)
|
||||
req, err := s.client.NewRequest("PUT", u, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
// RemoveSecurityManagerTeam removes a team from the list of security managers for an organization.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/orgs/security-managers#remove-a-security-manager-team
|
||||
func (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) {
|
||||
u := fmt.Sprintf("orgs/%v/security-managers/teams/%v", org, team)
|
||||
req, err := s.client.NewRequest("DELETE", u, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
39
vendor/github.com/google/go-github/v48/github/repos.go
generated
vendored
39
vendor/github.com/google/go-github/v48/github/repos.go
generated
vendored
|
|
@ -88,6 +88,7 @@ type Repository struct {
|
|||
HasPages *bool `json:"has_pages,omitempty"`
|
||||
HasProjects *bool `json:"has_projects,omitempty"`
|
||||
HasDownloads *bool `json:"has_downloads,omitempty"`
|
||||
HasDiscussions *bool `json:"has_discussions,omitempty"`
|
||||
IsTemplate *bool `json:"is_template,omitempty"`
|
||||
LicenseTemplate *string `json:"license_template,omitempty"`
|
||||
GitignoreTemplate *string `json:"gitignore_template,omitempty"`
|
||||
|
|
@ -365,12 +366,13 @@ type createRepoRequest struct {
|
|||
Description *string `json:"description,omitempty"`
|
||||
Homepage *string `json:"homepage,omitempty"`
|
||||
|
||||
Private *bool `json:"private,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
HasIssues *bool `json:"has_issues,omitempty"`
|
||||
HasProjects *bool `json:"has_projects,omitempty"`
|
||||
HasWiki *bool `json:"has_wiki,omitempty"`
|
||||
IsTemplate *bool `json:"is_template,omitempty"`
|
||||
Private *bool `json:"private,omitempty"`
|
||||
Visibility *string `json:"visibility,omitempty"`
|
||||
HasIssues *bool `json:"has_issues,omitempty"`
|
||||
HasProjects *bool `json:"has_projects,omitempty"`
|
||||
HasWiki *bool `json:"has_wiki,omitempty"`
|
||||
HasDiscussions *bool `json:"has_discussions,omitempty"`
|
||||
IsTemplate *bool `json:"is_template,omitempty"`
|
||||
|
||||
// Creating an organization repository. Required for non-owners.
|
||||
TeamID *int64 `json:"team_id,omitempty"`
|
||||
|
|
@ -423,6 +425,7 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo
|
|||
HasIssues: repo.HasIssues,
|
||||
HasProjects: repo.HasProjects,
|
||||
HasWiki: repo.HasWiki,
|
||||
HasDiscussions: repo.HasDiscussions,
|
||||
IsTemplate: repo.IsTemplate,
|
||||
TeamID: repo.TeamID,
|
||||
AutoInit: repo.AutoInit,
|
||||
|
|
@ -840,6 +843,10 @@ type Protection struct {
|
|||
AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"`
|
||||
AllowDeletions *AllowDeletions `json:"allow_deletions"`
|
||||
RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"`
|
||||
// LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch.
|
||||
LockBranch *bool `json:"lock_branch,omitempty"`
|
||||
// AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked.
|
||||
AllowForkSyncing *bool `json:"allow_fork_syncing,omitempty"`
|
||||
}
|
||||
|
||||
// BranchProtectionRule represents the rule applied to a repositories branch.
|
||||
|
|
@ -1019,7 +1026,7 @@ type RequiredStatusCheck struct {
|
|||
type PullRequestReviewsEnforcement struct {
|
||||
// Allow specific users, teams, or apps to bypass pull request requirements.
|
||||
BypassPullRequestAllowances *BypassPullRequestAllowances `json:"bypass_pull_request_allowances,omitempty"`
|
||||
// Specifies which users and teams can dismiss pull request reviews.
|
||||
// Specifies which users, teams and apps can dismiss pull request reviews.
|
||||
DismissalRestrictions *DismissalRestrictions `json:"dismissal_restrictions,omitempty"`
|
||||
// Specifies if approved reviews are dismissed automatically, when a new commit is pushed.
|
||||
DismissStaleReviews bool `json:"dismiss_stale_reviews"`
|
||||
|
|
@ -1028,6 +1035,8 @@ type PullRequestReviewsEnforcement struct {
|
|||
// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
|
||||
// Valid values are 1-6.
|
||||
RequiredApprovingReviewCount int `json:"required_approving_review_count"`
|
||||
// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
|
||||
RequireLastPushApproval bool `json:"require_last_push_approval"`
|
||||
}
|
||||
|
||||
// PullRequestReviewsEnforcementRequest represents request to set the pull request review
|
||||
|
|
@ -1036,8 +1045,8 @@ type PullRequestReviewsEnforcement struct {
|
|||
type PullRequestReviewsEnforcementRequest struct {
|
||||
// Allow specific users, teams, or apps to bypass pull request requirements.
|
||||
BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
|
||||
// Specifies which users and teams should be allowed to dismiss pull request reviews.
|
||||
// User and team dismissal restrictions are only available for
|
||||
// Specifies which users, teams and apps should be allowed to dismiss pull request reviews.
|
||||
// User, team and app dismissal restrictions are only available for
|
||||
// organization-owned repositories. Must be nil for personal repositories.
|
||||
DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"`
|
||||
// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. (Required)
|
||||
|
|
@ -1055,7 +1064,7 @@ type PullRequestReviewsEnforcementRequest struct {
|
|||
type PullRequestReviewsEnforcementUpdate struct {
|
||||
// Allow specific users, teams, or apps to bypass pull request requirements.
|
||||
BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
|
||||
// Specifies which users and teams can dismiss pull request reviews. Can be omitted.
|
||||
// Specifies which users, teams and apps can dismiss pull request reviews. Can be omitted.
|
||||
DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"`
|
||||
// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. Can be omitted.
|
||||
DismissStaleReviews *bool `json:"dismiss_stale_reviews,omitempty"`
|
||||
|
|
@ -1064,6 +1073,8 @@ type PullRequestReviewsEnforcementUpdate struct {
|
|||
// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
|
||||
// Valid values are 1 - 6 or 0 to not require reviewers.
|
||||
RequiredApprovingReviewCount int `json:"required_approving_review_count"`
|
||||
// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
|
||||
RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"`
|
||||
}
|
||||
|
||||
// RequireLinearHistory represents the configuration to enforce branches with no merge commit.
|
||||
|
|
@ -1113,7 +1124,7 @@ type BranchRestrictionsRequest struct {
|
|||
// The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.)
|
||||
Teams []string `json:"teams"`
|
||||
// The list of app slugs with push access.
|
||||
Apps []string `json:"apps,omitempty"`
|
||||
Apps []string `json:"apps"`
|
||||
}
|
||||
|
||||
// BypassPullRequestAllowances represents the people, teams, or apps who are allowed to bypass required pull requests.
|
||||
|
|
@ -1145,10 +1156,12 @@ type DismissalRestrictions struct {
|
|||
Users []*User `json:"users"`
|
||||
// The list of teams which can dismiss pull request reviews.
|
||||
Teams []*Team `json:"teams"`
|
||||
// The list of apps which can dismiss pull request reviews.
|
||||
Apps []*App `json:"apps"`
|
||||
}
|
||||
|
||||
// DismissalRestrictionsRequest represents the request to create/edit the
|
||||
// restriction to allows only specific users or teams to dimiss pull request reviews. It is
|
||||
// restriction to allows only specific users, teams or apps to dimiss pull request reviews. It is
|
||||
// separate from DismissalRestrictions above because the request structure is
|
||||
// different from the response structure.
|
||||
// Note: Both Users and Teams must be nil, or both must be non-nil.
|
||||
|
|
@ -1157,6 +1170,8 @@ type DismissalRestrictionsRequest struct {
|
|||
Users *[]string `json:"users,omitempty"`
|
||||
// The list of team slugs which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.)
|
||||
Teams *[]string `json:"teams,omitempty"`
|
||||
// The list of apps which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.)
|
||||
Apps *[]string `json:"apps,omitempty"`
|
||||
}
|
||||
|
||||
// SignaturesProtectedBranch represents the protection status of an individual branch.
|
||||
|
|
|
|||
55
vendor/github.com/google/go-github/v48/github/repos_actions_access.go
generated
vendored
Normal file
55
vendor/github.com/google/go-github/v48/github/repos_actions_access.go
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2022 The go-github AUTHORS. All rights reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// RepositoryActionsAccessLevel represents the repository actions access level.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository
|
||||
type RepositoryActionsAccessLevel struct {
|
||||
// AccessLevel specifies the level of access that workflows outside of the repository have
|
||||
// to actions and reusable workflows within the repository.
|
||||
// Possible values are: "none", "organization" "enterprise".
|
||||
AccessLevel *string `json:"access_level,omitempty"`
|
||||
}
|
||||
|
||||
// GetActionsAccessLevel gets the level of access that workflows outside of the repository have
|
||||
// to actions and reusable workflows in the repository.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository
|
||||
func (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo)
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
raal := new(RepositoryActionsAccessLevel)
|
||||
resp, err := s.client.Do(ctx, req, raal)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return raal, resp, nil
|
||||
}
|
||||
|
||||
// EditActionsAccessLevel sets the level of access that workflows outside of the repository have
|
||||
// to actions and reusable workflows in the repository.
|
||||
//
|
||||
// GitHub API docs: https://docs.github.com/en/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository
|
||||
func (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/actions/permissions/access", owner, repo)
|
||||
req, err := s.client.NewRequest("PUT", u, repositoryActionsAccessLevel)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
15
vendor/github.com/google/go-github/v48/github/repos_forks.go
generated
vendored
15
vendor/github.com/google/go-github/v48/github/repos_forks.go
generated
vendored
|
|
@ -7,9 +7,8 @@ package github
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// RepositoryListForksOptions specifies the optional parameters to the
|
||||
|
|
@ -53,9 +52,9 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string,
|
|||
// RepositoriesService.CreateFork method.
|
||||
type RepositoryCreateForkOptions struct {
|
||||
// The organization to fork the repository into.
|
||||
Organization string `url:"organization,omitempty"`
|
||||
Name string `url:"name,omitempty"`
|
||||
DefaultBranchOnly bool `url:"default_branch_only,omitempty"`
|
||||
Organization string `json:"organization,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
DefaultBranchOnly bool `json:"default_branch_only,omitempty"`
|
||||
}
|
||||
|
||||
// CreateFork creates a fork of the specified repository.
|
||||
|
|
@ -70,12 +69,8 @@ type RepositoryCreateForkOptions struct {
|
|||
// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork
|
||||
func (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/forks", owner, repo)
|
||||
u, err := addOptions(u, opts)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
req, err := s.client.NewRequest("POST", u, nil)
|
||||
req, err := s.client.NewRequest("POST", u, opts)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
|
|||
17
vendor/github.com/google/go-github/v48/github/repos_releases.go
generated
vendored
17
vendor/github.com/google/go-github/v48/github/repos_releases.go
generated
vendored
|
|
@ -19,12 +19,14 @@ import (
|
|||
|
||||
// RepositoryRelease represents a GitHub release in a repository.
|
||||
type RepositoryRelease struct {
|
||||
TagName *string `json:"tag_name,omitempty"`
|
||||
TargetCommitish *string `json:"target_commitish,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Body *string `json:"body,omitempty"`
|
||||
Draft *bool `json:"draft,omitempty"`
|
||||
Prerelease *bool `json:"prerelease,omitempty"`
|
||||
TagName *string `json:"tag_name,omitempty"`
|
||||
TargetCommitish *string `json:"target_commitish,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Body *string `json:"body,omitempty"`
|
||||
Draft *bool `json:"draft,omitempty"`
|
||||
Prerelease *bool `json:"prerelease,omitempty"`
|
||||
// MakeLatest can be one of: "true", "false", or "legacy".
|
||||
MakeLatest *string `json:"make_latest,omitempty"`
|
||||
DiscussionCategoryName *string `json:"discussion_category_name,omitempty"`
|
||||
|
||||
// The following fields are not used in EditRelease:
|
||||
|
|
@ -176,6 +178,7 @@ type repositoryReleaseRequest struct {
|
|||
Body *string `json:"body,omitempty"`
|
||||
Draft *bool `json:"draft,omitempty"`
|
||||
Prerelease *bool `json:"prerelease,omitempty"`
|
||||
MakeLatest *string `json:"make_latest,omitempty"`
|
||||
GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"`
|
||||
DiscussionCategoryName *string `json:"discussion_category_name,omitempty"`
|
||||
}
|
||||
|
|
@ -196,6 +199,7 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str
|
|||
Body: release.Body,
|
||||
Draft: release.Draft,
|
||||
Prerelease: release.Prerelease,
|
||||
MakeLatest: release.MakeLatest,
|
||||
DiscussionCategoryName: release.DiscussionCategoryName,
|
||||
GenerateReleaseNotes: release.GenerateReleaseNotes,
|
||||
}
|
||||
|
|
@ -229,6 +233,7 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin
|
|||
Body: release.Body,
|
||||
Draft: release.Draft,
|
||||
Prerelease: release.Prerelease,
|
||||
MakeLatest: release.MakeLatest,
|
||||
DiscussionCategoryName: release.DiscussionCategoryName,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue