Bump github.com/bradleyfalzon/ghinstallation/v2 from 2.14.0 to 2.15.0 (#517)

Bumps [github.com/bradleyfalzon/ghinstallation/v2](https://github.com/bradleyfalzon/ghinstallation) from 2.14.0 to 2.15.0.
- [Release notes](https://github.com/bradleyfalzon/ghinstallation/releases)
- [Commits](https://github.com/bradleyfalzon/ghinstallation/compare/v2.14.0...v2.15.0)

---
updated-dependencies:
- dependency-name: github.com/bradleyfalzon/ghinstallation/v2
  dependency-version: 2.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2025-05-01 07:17:49 -07:00
committed by GitHub
parent 1466d68918
commit 695fa448e5
184 changed files with 2540 additions and 251 deletions

4
go.mod
View File

@@ -6,7 +6,7 @@ toolchain go1.24.1
require (
code.gitea.io/sdk/gitea v0.20.0
github.com/MichaelMure/go-term-markdown v0.1.4
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0
github.com/bradleyfalzon/ghinstallation/v2 v2.15.0
github.com/briandowns/spinner v1.23.2
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/fatih/color v1.18.0
@@ -35,7 +35,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 // indirect
github.com/google/go-github/v69 v69.0.0 // indirect
github.com/google/go-github/v71 v71.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect

12
go.sum
View File

@@ -16,8 +16,8 @@ github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBo
github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI=
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY=
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0 h1:0D4vKCHOvYrDU8u61TnE2JfNT4VRrBLphmxtqazTO+M=
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0/go.mod h1:LOVmdZYVZ8jqdr4n9wWm1ocDiMz9IfMGfRkaYC1a52A=
github.com/bradleyfalzon/ghinstallation/v2 v2.15.0 h1:7r2rPUM04rgszMP0U1UZ1M5VoVVIlsaBSnpABfYxcQY=
github.com/bradleyfalzon/ghinstallation/v2 v2.15.0/go.mod h1:PoH9Vhy82OeRFZfxsVrk3mfQhVkEzou9OOwPOsEhiXE=
github.com/briandowns/spinner v1.23.2 h1:Zc6ecUnI+YzLmJniCfDNaMbW0Wid1d5+qcTq4L2FW8w=
github.com/briandowns/spinner v1.23.2/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
@@ -53,12 +53,12 @@ github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 h1:Qxs3bNRWe8G
github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4=
github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4=
github.com/google/go-github/v69 v69.0.0 h1:YnFvZ3pEIZF8KHmI8xyQQe3mYACdkhnaTV2hr7CP2/w=
github.com/google/go-github/v69 v69.0.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM=
github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30=
github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=

View File

@@ -1,16 +1,11 @@
run:
timeout: 10m
version: "2"
linters:
disable-all: true
default: none
enable:
- errcheck
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- misspell
@@ -19,3 +14,24 @@ linters:
- staticcheck
- unconvert
- unused
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

View File

@@ -13,7 +13,7 @@ import (
"sync"
"time"
"github.com/google/go-github/v69/github"
"github.com/google/go-github/v71/github"
)
const (

View File

@@ -1,143 +0,0 @@
// Copyright 2020 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package github
// Package represents a GitHub package.
type Package struct {
ID *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PackageType *string `json:"package_type,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
Owner *User `json:"owner,omitempty"`
PackageVersion *PackageVersion `json:"package_version,omitempty"`
Registry *PackageRegistry `json:"registry,omitempty"`
URL *string `json:"url,omitempty"`
VersionCount *int64 `json:"version_count,omitempty"`
Visibility *string `json:"visibility,omitempty"`
Repository *Repository `json:"repository,omitempty"`
}
func (p Package) String() string {
return Stringify(p)
}
// PackageVersion represents a GitHub package version.
type PackageVersion struct {
ID *int64 `json:"id,omitempty"`
Version *string `json:"version,omitempty"`
Summary *string `json:"summary,omitempty"`
Body *string `json:"body,omitempty"`
BodyHTML *string `json:"body_html,omitempty"`
Release *PackageRelease `json:"release,omitempty"`
Manifest *string `json:"manifest,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
TagName *string `json:"tag_name,omitempty"`
TargetCommitish *string `json:"target_commitish,omitempty"`
TargetOID *string `json:"target_oid,omitempty"`
Draft *bool `json:"draft,omitempty"`
Prerelease *bool `json:"prerelease,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
PackageFiles []*PackageFile `json:"package_files,omitempty"`
Author *User `json:"author,omitempty"`
InstallationCommand *string `json:"installation_command,omitempty"`
Metadata *PackageMetadata `json:"metadata,omitempty"`
PackageHTMLURL *string `json:"package_html_url,omitempty"`
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
}
func (pv PackageVersion) String() string {
return Stringify(pv)
}
// PackageRelease represents a GitHub package version release.
type PackageRelease struct {
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
ID *int64 `json:"id,omitempty"`
TagName *string `json:"tag_name,omitempty"`
TargetCommitish *string `json:"target_commitish,omitempty"`
Name *string `json:"name,omitempty"`
Draft *bool `json:"draft,omitempty"`
Author *User `json:"author,omitempty"`
Prerelease *bool `json:"prerelease,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
PublishedAt *Timestamp `json:"published_at,omitempty"`
}
func (r PackageRelease) String() string {
return Stringify(r)
}
// PackageFile represents a GitHub package version release file.
type PackageFile struct {
DownloadURL *string `json:"download_url,omitempty"`
ID *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
SHA256 *string `json:"sha256,omitempty"`
SHA1 *string `json:"sha1,omitempty"`
MD5 *string `json:"md5,omitempty"`
ContentType *string `json:"content_type,omitempty"`
State *string `json:"state,omitempty"`
Author *User `json:"author,omitempty"`
Size *int64 `json:"size,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
}
func (pf PackageFile) String() string {
return Stringify(pf)
}
// PackageRegistry represents a GitHub package registry.
type PackageRegistry struct {
AboutURL *string `json:"about_url,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
URL *string `json:"url,omitempty"`
Vendor *string `json:"vendor,omitempty"`
}
func (r PackageRegistry) String() string {
return Stringify(r)
}
// PackageListOptions represents the optional list options for a package.
type PackageListOptions struct {
// Visibility of packages "public", "internal" or "private".
Visibility *string `url:"visibility,omitempty"`
// PackageType represents the type of package.
// It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container".
PackageType *string `url:"package_type,omitempty"`
// State of package either "active" or "deleted".
State *string `url:"state,omitempty"`
ListOptions
}
// PackageMetadata represents metadata from a package.
type PackageMetadata struct {
PackageType *string `json:"package_type,omitempty"`
Container *PackageContainerMetadata `json:"container,omitempty"`
}
func (r PackageMetadata) String() string {
return Stringify(r)
}
// PackageContainerMetadata represents container metadata for docker container packages.
type PackageContainerMetadata struct {
Tags []string `json:"tags,omitempty"`
}
func (r PackageContainerMetadata) String() string {
return Stringify(r)
}

View File

@@ -0,0 +1,376 @@
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package github
import (
"context"
"errors"
"fmt"
)
// HostedRunnerPublicIP represents the details of a public IP for GitHub-hosted runner.
type HostedRunnerPublicIP struct {
Enabled bool `json:"enabled"` // Whether public IP is enabled.
Prefix string `json:"prefix"` // The prefix for the public IP. Example: 20.80.208.150
Length int `json:"length"` // The length of the IP prefix. Example: 28
}
// HostedRunnerMachineSpec represents the details of a particular machine specification for GitHub-hosted runner.
type HostedRunnerMachineSpec struct {
ID string `json:"id"` // The ID used for the `size` parameter when creating a new runner. Example: 8-core
CPUCores int `json:"cpu_cores"` // The number of cores. Example: 8
MemoryGB int `json:"memory_gb"` // The available RAM for the machine spec. Example: 32
StorageGB int `json:"storage_gb"` // The available SSD storage for the machine spec. Example: 300
}
// HostedRunner represents a single GitHub-hosted runner with additional details.
type HostedRunner struct {
ID *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
RunnerGroupID *int64 `json:"runner_group_id,omitempty"`
Platform *string `json:"platform,omitempty"`
ImageDetails *HostedRunnerImageDetail `json:"image_details,omitempty"`
MachineSizeDetails *HostedRunnerMachineSpec `json:"machine_size_details,omitempty"`
Status *string `json:"status,omitempty"`
MaximumRunners *int64 `json:"maximum_runners,omitempty"`
PublicIPEnabled *bool `json:"public_ip_enabled,omitempty"`
PublicIPs []*HostedRunnerPublicIP `json:"public_ips,omitempty"`
LastActiveOn *Timestamp `json:"last_active_on,omitempty"`
}
// HostedRunnerImageDetail represents the image details of a GitHub-hosted runners.
type HostedRunnerImageDetail struct {
ID *string `json:"id"` // The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. Example: ubuntu-20.04
SizeGB *int64 `json:"size_gb"` // Image size in GB. Example: 86
DisplayName *string `json:"display_name"` // Display name for this image. Example: 20.04
Source *string `json:"source"` // The image provider. Example: github, partner, custom
Version *string `json:"version"` // The image version of the hosted runner pool. Example: latest
}
// HostedRunners represents a collection of GitHub-hosted runners for an organization.
type HostedRunners struct {
TotalCount int `json:"total_count"`
Runners []*HostedRunner `json:"runners"`
}
// ListHostedRunners lists all the GitHub-hosted runners for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners
func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org)
u, err := addOptions(u, opts)
if err != nil {
return nil, nil, err
}
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
runners := &HostedRunners{}
resp, err := s.client.Do(ctx, req, &runners)
if err != nil {
return nil, resp, err
}
return runners, resp, nil
}
// HostedRunnerImage represents the image of GitHub-hosted runners.
// To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner.
type HostedRunnerImage struct {
ID string `json:"id"`
Source string `json:"source"`
Version string `json:"version"`
}
// HostedRunnerRequest specifies body parameters to Hosted Runner configuration.
type HostedRunnerRequest struct {
Name string `json:"name,omitempty"`
Image HostedRunnerImage `json:"image,omitempty"`
RunnerGroupID int64 `json:"runner_group_id,omitempty"`
Size string `json:"size,omitempty"`
MaximumRunners int64 `json:"maximum_runners,omitempty"`
EnableStaticIP bool `json:"enable_static_ip,omitempty"`
ImageVersion string `json:"image_version,omitempty"`
}
// validateCreateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure
// that all required fields are properly set and that no invalid fields are present for hosted runner create request.
//
// If any of these conditions are violated, an appropriate error message is returned.
// Otherwise, nil is returned, indicating the request is valid.
func validateCreateHostedRunnerRequest(request *HostedRunnerRequest) error {
if request.Size == "" {
return errors.New("size is required for creating a hosted runner")
}
if request.Image == (HostedRunnerImage{}) {
return errors.New("image is required for creating a hosted runner")
}
if request.Name == "" {
return errors.New("name is required for creating a hosted runner")
}
if request.RunnerGroupID == 0 {
return errors.New("runner group ID is required for creating a hosted runner")
}
if request.ImageVersion != "" {
return errors.New("imageVersion should not be set directly; use the Image struct to specify image details")
}
return nil
}
// CreateHostedRunner creates a GitHub-hosted runner for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization
//
//meta:operation POST /orgs/{org}/actions/hosted-runners
func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) {
if err := validateCreateHostedRunnerRequest(request); err != nil {
return nil, nil, fmt.Errorf("validation failed: %w", err)
}
u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org)
req, err := s.client.NewRequest("POST", u, request)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}
// HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image.
type HostedRunnerImageSpecs struct {
ID string `json:"id"`
Platform string `json:"platform"`
SizeGB int `json:"size_gb"`
DisplayName string `json:"display_name"`
Source string `json:"source"`
}
// HostedRunnerImages represents the response containing the total count and details of runner images.
type HostedRunnerImages struct {
TotalCount int `json:"total_count"`
Images []*HostedRunnerImageSpecs `json:"images"`
}
// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned
func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/github-owned", org)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunnerImages := new(HostedRunnerImages)
resp, err := s.client.Do(ctx, req, hostedRunnerImages)
if err != nil {
return nil, resp, err
}
return hostedRunnerImages, resp, nil
}
// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner
func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/partner", org)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunnerImages := new(HostedRunnerImages)
resp, err := s.client.Do(ctx, req, hostedRunnerImages)
if err != nil {
return nil, resp, err
}
return hostedRunnerImages, resp, nil
}
// HostedRunnerPublicIPLimits represents the static public IP limits for GitHub-hosted runners.
type HostedRunnerPublicIPLimits struct {
PublicIPs *PublicIPUsage `json:"public_ips"`
}
// PublicIPUsage provides details of static public IP limits for GitHub-hosted runners.
type PublicIPUsage struct {
Maximum int64 `json:"maximum"` // The maximum number of static public IP addresses that can be used for Hosted Runners. Example: 50
CurrentUsage int64 `json:"current_usage"` // The current number of static public IP addresses in use by Hosted Runners. Example: 17
}
// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners/limits
func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/limits", org)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
publicIPLimits := new(HostedRunnerPublicIPLimits)
resp, err := s.client.Do(ctx, req, publicIPLimits)
if err != nil {
return nil, resp, err
}
return publicIPLimits, resp, nil
}
// HostedRunnerMachineSpecs represents the response containing the total count and details of machine specs for GitHub-hosted runners.
type HostedRunnerMachineSpecs struct {
TotalCount int `json:"total_count"`
MachineSpecs []*HostedRunnerMachineSpec `json:"machine_specs"`
}
// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes
func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/machine-sizes", org)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
machineSpecs := new(HostedRunnerMachineSpecs)
resp, err := s.client.Do(ctx, req, machineSpecs)
if err != nil {
return nil, resp, err
}
return machineSpecs, resp, nil
}
// HostedRunnerPlatforms represents the response containing the total count and platforms for GitHub-hosted runners.
type HostedRunnerPlatforms struct {
TotalCount int `json:"total_count"`
Platforms []string `json:"platforms"`
}
// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners/platforms
func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/platforms", org)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
platforms := new(HostedRunnerPlatforms)
resp, err := s.client.Do(ctx, req, platforms)
if err != nil {
return nil, resp, err
}
return platforms, resp, nil
}
// GetHostedRunner gets a GitHub-hosted runner in an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization
//
//meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}
func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}
// validateUpdateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure
// that no disallowed updates are made for a hosted runner update request.
//
// If any of these conditions are violated, an appropriate error message is returned.
// Otherwise, nil is returned, indicating the request is valid for an update.
func validateUpdateHostedRunnerRequest(request *HostedRunnerRequest) error {
if request.Size != "" {
return errors.New("size cannot be updated, API does not support updating size")
}
if request.Image != (HostedRunnerImage{}) {
return errors.New("image struct should not be set directly; use the ImageVersion to specify version details")
}
return nil
}
// UpdateHostedRunner updates a GitHub-hosted runner for an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization
//
//meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}
func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) {
if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil {
return nil, nil, fmt.Errorf("validation failed: %w", err)
}
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID)
req, err := s.client.NewRequest("PATCH", u, updateReq)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}
// DeleteHostedRunner deletes GitHub-hosted runner from an organization.
//
// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization
//
//meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}
func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID)
req, err := s.client.NewRequest("DELETE", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}

View File

@@ -204,6 +204,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner,
}
// GetWorkflowRunByID gets a specific workflow run by ID.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run
//
@@ -226,6 +227,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str
}
// GetWorkflowRunAttempt gets a specific workflow run attempt.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt
//
@@ -252,6 +254,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo
}
// GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs
//
@@ -302,6 +305,7 @@ func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Cont
}
// RerunWorkflowByID re-runs a workflow by ID.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID a the DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow
//
@@ -318,6 +322,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri
}
// RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run
//
@@ -335,6 +340,8 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st
// RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID.
//
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run
//
//meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun
@@ -350,6 +357,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j
}
// CancelWorkflowRunByID cancels a workflow run by ID.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run
//
@@ -366,6 +374,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo
}
// GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs
//
@@ -416,6 +425,7 @@ func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u
}
// DeleteWorkflowRun deletes a workflow run by ID.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run
//
@@ -432,6 +442,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri
}
// DeleteWorkflowRunLogs deletes all logs for a workflow run.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs
//
@@ -448,6 +459,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo
}
// GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage
//
@@ -470,6 +482,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep
}
// GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run
//
@@ -492,6 +505,7 @@ func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo
}
// PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run
//
@@ -514,6 +528,7 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str
}
// ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run.
// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.
//
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run
//

View File

@@ -82,7 +82,7 @@ func (m Enterprise) String() string {
// UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user
//
//meta:operation PATCH /admin/ldap/users/{username}/mapping
func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) {
@@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m
// UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team
//
//meta:operation PATCH /admin/ldap/teams/{team_id}/mapping
func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) {

View File

@@ -22,7 +22,7 @@ type createOrgRequest struct {
// Note that only a subset of the org fields are used and org must
// not be nil.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#create-an-organization
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#create-an-organization
//
//meta:operation POST /admin/organizations
func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) {
@@ -61,7 +61,7 @@ type RenameOrgResponse struct {
// RenameOrg renames an organization in GitHub Enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name
//
//meta:operation PATCH /admin/organizations/{org}
func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) {
@@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName
// RenameOrgByName renames an organization in GitHub Enterprise using its current name.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/orgs#update-an-organization-name
//
//meta:operation PATCH /admin/organizations/{org}
func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) {

View File

@@ -152,7 +152,7 @@ func (s RepoStats) String() string {
// Please note that this is only available to site administrators,
// otherwise it will error with a 404 not found (instead of 401 or 403).
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/admin-stats#get-all-statistics
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/admin-stats#get-all-statistics
//
//meta:operation GET /enterprise/stats/all
func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) {

View File

@@ -20,7 +20,7 @@ type CreateUserRequest struct {
// CreateUser creates a new user in GitHub Enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-a-user
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-a-user
//
//meta:operation POST /admin/users
func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) {
@@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest
// DeleteUser deletes a user in GitHub Enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-a-user
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-a-user
//
//meta:operation DELETE /admin/users/{username}
func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) {
@@ -95,7 +95,7 @@ type UserAuthorization struct {
// CreateUserImpersonation creates an impersonation OAuth token.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token
//
//meta:operation POST /admin/users/{username}/authorizations
func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) {
@@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str
// DeleteUserImpersonation deletes an impersonation OAuth token.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
//
//meta:operation DELETE /admin/users/{username}/authorizations
func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) {

View File

@@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces
// you can e.g. create or delete a user's public SSH key. NOTE: creating a
// new token automatically revokes an existing one.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#create-an-impersonation-oauth-token
//
//meta:operation POST /admin/users/{username}/authorizations
func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) {
@@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam
//
// NOTE: there can be only one at a time.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
//
//meta:operation DELETE /admin/users/{username}/authorizations
func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) {

View File

@@ -141,6 +141,15 @@ type AlertListOptions struct {
// The name of a code scanning tool. Only results by this tool will be listed.
ToolName string `url:"tool_name,omitempty"`
// The GUID of a code scanning tool. Only results by this tool will be listed.
ToolGUID string `url:"tool_guid,omitempty"`
// The direction to sort the results by. Possible values are: asc, desc. Default: desc.
Direction string `url:"direction,omitempty"`
// The property by which to sort the results. Possible values are: created, updated. Default: created.
Sort string `url:"sort,omitempty"`
ListCursorOptions
// Add ListOptions so offset pagination with integer type "page" query parameter is accepted

View File

@@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API.
Usage:
import "github.com/google/go-github/v69/github" // with go modules enabled (GO111MODULE=on or outside GOPATH)
import "github.com/google/go-github/v71/github" // with go modules enabled (GO111MODULE=on or outside GOPATH)
import "github.com/google/go-github/github" // with go modules disabled
Construct a new GitHub client, then use the various services on the client to
@@ -138,11 +138,17 @@ To detect this condition of error, you can check if its type is
# Conditional Requests
The GitHub API has good support for conditional requests which will help
prevent you from burning through your rate limit, as well as help speed up your
application. go-github does not handle conditional requests directly, but is
instead designed to work with a caching http.Transport. We recommend using
https://github.com/gregjones/httpcache for that.
The GitHub REST API has good support for conditional HTTP requests
via the ETag header which will help prevent you from burning through your
rate limit, as well as help speed up your application. go-github does not
handle conditional requests directly, but is instead designed to work with a
caching http.Transport.
Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache
is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport
package relies on (undocumented) GitHub specific cache logic and is
recommended when making requests using short-lived credentials such as a
GitHub App installation token.
Learn more about GitHub conditional requests at
https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requests.

View File

@@ -0,0 +1,234 @@
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package github
import (
"context"
"fmt"
)
// ListHostedRunners lists all the GitHub-hosted runners for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners
func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise)
u, err := addOptions(u, opts)
if err != nil {
return nil, nil, err
}
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
runners := &HostedRunners{}
resp, err := s.client.Do(ctx, req, &runners)
if err != nil {
return nil, resp, err
}
return runners, resp, nil
}
// CreateHostedRunner creates a GitHub-hosted runner for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise
//
//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners
func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) {
if err := validateCreateHostedRunnerRequest(request); err != nil {
return nil, nil, fmt.Errorf("validation failed: %w", err)
}
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise)
req, err := s.client.NewRequest("POST", u, request)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}
// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned
func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunnerImages := new(HostedRunnerImages)
resp, err := s.client.Do(ctx, req, hostedRunnerImages)
if err != nil {
return nil, resp, err
}
return hostedRunnerImages, resp, nil
}
// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner
func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunnerImages := new(HostedRunnerImages)
resp, err := s.client.Do(ctx, req, hostedRunnerImages)
if err != nil {
return nil, resp, err
}
return hostedRunnerImages, resp, nil
}
// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits
func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
publicIPLimits := new(HostedRunnerPublicIPLimits)
resp, err := s.client.Do(ctx, req, publicIPLimits)
if err != nil {
return nil, resp, err
}
return publicIPLimits, resp, nil
}
// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes
func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
machineSpecs := new(HostedRunnerMachineSpecs)
resp, err := s.client.Do(ctx, req, machineSpecs)
if err != nil {
return nil, resp, err
}
return machineSpecs, resp, nil
}
// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms
func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
platforms := new(HostedRunnerPlatforms)
resp, err := s.client.Do(ctx, req, platforms)
if err != nil {
return nil, resp, err
}
return platforms, resp, nil
}
// GetHostedRunner gets a GitHub-hosted runner in an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}
// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise
//
//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) {
if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil {
return nil, nil, fmt.Errorf("validation failed: %w", err)
}
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID)
req, err := s.client.NewRequest("PATCH", u, updateReq)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}
// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise
//
//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID)
req, err := s.client.NewRequest("DELETE", u, nil)
if err != nil {
return nil, nil, err
}
hostedRunner := new(HostedRunner)
resp, err := s.client.Do(ctx, req, hostedRunner)
if err != nil {
return nil, resp, err
}
return hostedRunner, resp, nil
}

View File

@@ -74,7 +74,7 @@ type ReleaseVersion struct {
// CheckSystemRequirements checks if GHES system nodes meet the system requirements.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes
//
//meta:operation GET /manage/v1/checks/system-requirements
func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) {
@@ -95,7 +95,7 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste
// ClusterStatus gets the status of all services running on each cluster node.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes
//
//meta:operation GET /manage/v1/cluster/status
func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) {
@@ -116,7 +116,7 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus,
// ReplicationStatus gets the status of all services running on each replica node.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes
//
//meta:operation GET /manage/v1/replication/status
func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) {
@@ -140,7 +140,7 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue
// GetNodeReleaseVersions gets the version information deployed to each node.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes
//
//meta:operation GET /manage/v1/version
func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) {

View File

@@ -305,7 +305,7 @@ type NodeDetails struct {
// ConfigApplyEvents gets events from the command ghe-config-apply.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply
//
//meta:operation GET /manage/v1/config/apply/events
func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) {
@@ -330,7 +330,7 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA
// InitialConfig initializes the GitHub Enterprise instance with a license and password.
// After initializing the instance, you need to run an apply to apply the configuration.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password
//
//meta:operation POST /manage/v1/config/init
func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) {
@@ -351,7 +351,7 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password
// License gets the current license information for the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information
//
//meta:operation GET /manage/v1/config/license
func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) {
@@ -372,7 +372,7 @@ func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Res
// UploadLicense uploads a new license to the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license
//
//meta:operation PUT /manage/v1/config/license
func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) {
@@ -390,7 +390,7 @@ func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (
// LicenseStatus gets the current license status for the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#check-a-license
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#check-a-license
//
//meta:operation GET /manage/v1/config/license/check
func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) {
@@ -412,7 +412,7 @@ func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck,
// NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance.
// This is required for clustered setups.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes
//
//meta:operation GET /manage/v1/config/nodes
func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) {
@@ -436,7 +436,7 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt
// Settings gets the current configuration settings for the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-ghes-settings
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-ghes-settings
//
//meta:operation GET /manage/v1/config/settings
func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) {
@@ -457,7 +457,7 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res
// UpdateSettings updates the configuration settings for the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-settings
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-settings
//
//meta:operation PUT /manage/v1/config/settings
func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) {
@@ -476,7 +476,7 @@ func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSett
// ConfigApply triggers a configuration apply run on the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run
//
//meta:operation POST /manage/v1/config/apply
func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) {
@@ -497,7 +497,7 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp
// ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance.
// You can request lat one or specific id one.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run
//
//meta:operation GET /manage/v1/config/apply
func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) {

View File

@@ -46,7 +46,7 @@ type MaintenanceOptions struct {
// GetMaintenanceStatus gets the status of maintenance mode for all nodes.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode
//
//meta:operation GET /manage/v1/maintenance
func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) {
@@ -71,7 +71,7 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node
// CreateMaintenance sets the maintenance mode for the instance.
// With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode
//
//meta:operation POST /manage/v1/maintenance
func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) {

View File

@@ -31,7 +31,7 @@ type ClusterSSHKey struct {
// DeleteSSHKey deletes the SSH key from the instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#delete-a-ssh-key
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#delete-a-ssh-key
//
//meta:operation DELETE /manage/v1/access/ssh
func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) {
@@ -55,7 +55,7 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS
// GetSSHKey gets the SSH keys configured for the instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys
//
//meta:operation GET /manage/v1/access/ssh
func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) {
@@ -76,7 +76,7 @@ func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *R
// CreateSSHKey adds a new SSH key to the instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key
//
//meta:operation POST /manage/v1/access/ssh
func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) {

View File

@@ -0,0 +1,139 @@
// Copyright 2025 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package github
import (
"context"
"fmt"
)
// ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/network-configurations
func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) {
u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise)
u, err := addOptions(u, opts)
if err != nil {
return nil, nil, err
}
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
networks := &NetworkConfigurations{}
resp, err := s.client.Do(ctx, req, networks)
if err != nil {
return nil, resp, err
}
return networks, resp, nil
}
// CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise
//
//meta:operation POST /enterprises/{enterprise}/network-configurations
func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) {
if err := validateNetworkConfigurationRequest(createReq); err != nil {
return nil, nil, fmt.Errorf("validation failed: %w", err)
}
u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise)
req, err := s.client.NewRequest("POST", u, createReq)
if err != nil {
return nil, nil, err
}
network := &NetworkConfiguration{}
resp, err := s.client.Do(ctx, req, network)
if err != nil {
return nil, resp, err
}
return network, resp, nil
}
// GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id}
func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) {
u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
network := &NetworkConfiguration{}
resp, err := s.client.Do(ctx, req, network)
if err != nil {
return nil, resp, err
}
return network, resp, nil
}
// UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise
//
//meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id}
func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) {
if err := validateNetworkConfigurationRequest(updateReq); err != nil {
return nil, nil, fmt.Errorf("validation failed: %w", err)
}
u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID)
req, err := s.client.NewRequest("PATCH", u, updateReq)
if err != nil {
return nil, nil, err
}
network := &NetworkConfiguration{}
resp, err := s.client.Do(ctx, req, network)
if err != nil {
return nil, resp, err
}
return network, resp, nil
}
// DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise
//
//meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id}
func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) {
u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID)
req, err := s.client.NewRequest("DELETE", u, nil)
if err != nil {
return nil, err
}
return s.client.Do(ctx, req, nil)
}
// GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id}
func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) {
u := fmt.Sprintf("enterprises/%v/network-settings/%v", enterprise, networkID)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
resource := &NetworkSettingsResource{}
resp, err := s.client.Do(ctx, req, resource)
if err != nil {
return nil, resp, err
}
return resource, resp, err
}

View File

@@ -858,8 +858,10 @@ type MergeGroup struct {
//
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group
type MergeGroupEvent struct {
// The action that was performed. Currently, can only be checks_requested.
// The action that was performed. Possible values are: "checks_requested", "destroyed".
Action *string `json:"action,omitempty"`
// Reason is populated when the action is "destroyed". Possible values: "merged", "invalidated", "dequeued".
Reason *string `json:"reason,omitempty"`
// The merge group.
MergeGroup *MergeGroup `json:"merge_group,omitempty"`

View File

@@ -5902,6 +5902,30 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string {
return *c.Name
}
// GetColor returns the Color field if it's non-nil, zero value otherwise.
func (c *CreateOrUpdateIssueTypesOptions) GetColor() string {
if c == nil || c.Color == nil {
return ""
}
return *c.Color
}
// GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (c *CreateOrUpdateIssueTypesOptions) GetDescription() string {
if c == nil || c.Description == nil {
return ""
}
return *c.Description
}
// GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise.
func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool {
if c == nil || c.IsPrivate == nil {
return false
}
return *c.IsPrivate
}
// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.
func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string {
if c == nil || c.BaseRole == nil {
@@ -10182,6 +10206,134 @@ func (h *HookStats) GetTotalHooks() int {
return *h.TotalHooks
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetID() int64 {
if h == nil || h.ID == nil {
return 0
}
return *h.ID
}
// GetImageDetails returns the ImageDetails field.
func (h *HostedRunner) GetImageDetails() *HostedRunnerImageDetail {
if h == nil {
return nil
}
return h.ImageDetails
}
// GetLastActiveOn returns the LastActiveOn field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetLastActiveOn() Timestamp {
if h == nil || h.LastActiveOn == nil {
return Timestamp{}
}
return *h.LastActiveOn
}
// GetMachineSizeDetails returns the MachineSizeDetails field.
func (h *HostedRunner) GetMachineSizeDetails() *HostedRunnerMachineSpec {
if h == nil {
return nil
}
return h.MachineSizeDetails
}
// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetMaximumRunners() int64 {
if h == nil || h.MaximumRunners == nil {
return 0
}
return *h.MaximumRunners
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetName() string {
if h == nil || h.Name == nil {
return ""
}
return *h.Name
}
// GetPlatform returns the Platform field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetPlatform() string {
if h == nil || h.Platform == nil {
return ""
}
return *h.Platform
}
// GetPublicIPEnabled returns the PublicIPEnabled field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetPublicIPEnabled() bool {
if h == nil || h.PublicIPEnabled == nil {
return false
}
return *h.PublicIPEnabled
}
// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetRunnerGroupID() int64 {
if h == nil || h.RunnerGroupID == nil {
return 0
}
return *h.RunnerGroupID
}
// GetStatus returns the Status field if it's non-nil, zero value otherwise.
func (h *HostedRunner) GetStatus() string {
if h == nil || h.Status == nil {
return ""
}
return *h.Status
}
// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.
func (h *HostedRunnerImageDetail) GetDisplayName() string {
if h == nil || h.DisplayName == nil {
return ""
}
return *h.DisplayName
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (h *HostedRunnerImageDetail) GetID() string {
if h == nil || h.ID == nil {
return ""
}
return *h.ID
}
// GetSizeGB returns the SizeGB field if it's non-nil, zero value otherwise.
func (h *HostedRunnerImageDetail) GetSizeGB() int64 {
if h == nil || h.SizeGB == nil {
return 0
}
return *h.SizeGB
}
// GetSource returns the Source field if it's non-nil, zero value otherwise.
func (h *HostedRunnerImageDetail) GetSource() string {
if h == nil || h.Source == nil {
return ""
}
return *h.Source
}
// GetVersion returns the Version field if it's non-nil, zero value otherwise.
func (h *HostedRunnerImageDetail) GetVersion() string {
if h == nil || h.Version == nil {
return ""
}
return *h.Version
}
// GetPublicIPs returns the PublicIPs field.
func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage {
if h == nil {
return nil
}
return h.PublicIPs
}
// GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise.
func (i *IDPGroup) GetGroupDescription() string {
if i == nil || i.GroupDescription == nil {
@@ -14110,6 +14262,14 @@ func (m *MergeGroupEvent) GetOrg() *Organization {
return m.Org
}
// GetReason returns the Reason field if it's non-nil, zero value otherwise.
func (m *MergeGroupEvent) GetReason() string {
if m == nil || m.Reason == nil {
return ""
}
return *m.Reason
}
// GetRepo returns the Repo field.
func (m *MergeGroupEvent) GetRepo() *Repository {
if m == nil {
@@ -14582,6 +14742,102 @@ func (m *MostRecentInstance) GetState() string {
return *m.State
}
// GetComputeService returns the ComputeService field.
func (n *NetworkConfiguration) GetComputeService() *ComputeService {
if n == nil {
return nil
}
return n.ComputeService
}
// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.
func (n *NetworkConfiguration) GetCreatedOn() Timestamp {
if n == nil || n.CreatedOn == nil {
return Timestamp{}
}
return *n.CreatedOn
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (n *NetworkConfiguration) GetID() string {
if n == nil || n.ID == nil {
return ""
}
return *n.ID
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (n *NetworkConfiguration) GetName() string {
if n == nil || n.Name == nil {
return ""
}
return *n.Name
}
// GetComputeService returns the ComputeService field.
func (n *NetworkConfigurationRequest) GetComputeService() *ComputeService {
if n == nil {
return nil
}
return n.ComputeService
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (n *NetworkConfigurationRequest) GetName() string {
if n == nil || n.Name == nil {
return ""
}
return *n.Name
}
// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.
func (n *NetworkConfigurations) GetTotalCount() int64 {
if n == nil || n.TotalCount == nil {
return 0
}
return *n.TotalCount
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (n *NetworkSettingsResource) GetID() string {
if n == nil || n.ID == nil {
return ""
}
return *n.ID
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (n *NetworkSettingsResource) GetName() string {
if n == nil || n.Name == nil {
return ""
}
return *n.Name
}
// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.
func (n *NetworkSettingsResource) GetNetworkConfigurationID() string {
if n == nil || n.NetworkConfigurationID == nil {
return ""
}
return *n.NetworkConfigurationID
}
// GetRegion returns the Region field if it's non-nil, zero value otherwise.
func (n *NetworkSettingsResource) GetRegion() string {
if n == nil || n.Region == nil {
return ""
}
return *n.Region
}
// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise.
func (n *NetworkSettingsResource) GetSubnetID() string {
if n == nil || n.SubnetID == nil {
return ""
}
return *n.SubnetID
}
// GetBase returns the Base field if it's non-nil, zero value otherwise.
func (n *NewPullRequest) GetBase() string {
if n == nil || n.Base == nil {
@@ -15582,6 +15838,22 @@ func (p *Package) GetCreatedAt() Timestamp {
return *p.CreatedAt
}
// GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (p *Package) GetDescription() string {
if p == nil || p.Description == nil {
return ""
}
return *p.Description
}
// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.
func (p *Package) GetEcosystem() string {
if p == nil || p.Ecosystem == nil {
return ""
}
return *p.Ecosystem
}
// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
func (p *Package) GetHTMLURL() string {
if p == nil || p.HTMLURL == nil {
@@ -15606,6 +15878,14 @@ func (p *Package) GetName() string {
return *p.Name
}
// GetNamespace returns the Namespace field if it's non-nil, zero value otherwise.
func (p *Package) GetNamespace() string {
if p == nil || p.Namespace == nil {
return ""
}
return *p.Namespace
}
// GetOwner returns the Owner field.
func (p *Package) GetOwner() *User {
if p == nil {
@@ -15726,6 +16006,46 @@ func (p *PackageEvent) GetSender() *User {
return p.Sender
}
// GetLabels returns the Labels map if it's non-nil, an empty map otherwise.
func (p *PackageEventContainerMetadata) GetLabels() map[string]any {
if p == nil || p.Labels == nil {
return map[string]any{}
}
return p.Labels
}
// GetManifest returns the Manifest map if it's non-nil, an empty map otherwise.
func (p *PackageEventContainerMetadata) GetManifest() map[string]any {
if p == nil || p.Manifest == nil {
return map[string]any{}
}
return p.Manifest
}
// GetTag returns the Tag field.
func (p *PackageEventContainerMetadata) GetTag() *PackageEventContainerMetadataTag {
if p == nil {
return nil
}
return p.Tag
}
// GetDigest returns the Digest field if it's non-nil, zero value otherwise.
func (p *PackageEventContainerMetadataTag) GetDigest() string {
if p == nil || p.Digest == nil {
return ""
}
return *p.Digest
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (p *PackageEventContainerMetadataTag) GetName() string {
if p == nil || p.Name == nil {
return ""
}
return *p.Name
}
// GetAuthor returns the Author field.
func (p *PackageFile) GetAuthor() *User {
if p == nil {
@@ -15862,6 +16182,262 @@ func (p *PackageMetadata) GetPackageType() string {
return *p.PackageType
}
// GetAuthor returns the Author map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetAuthor() map[string]string {
if p == nil || p.Author == nil {
return map[string]string{}
}
return p.Author
}
// GetBin returns the Bin map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetBin() map[string]any {
if p == nil || p.Bin == nil {
return map[string]any{}
}
return p.Bin
}
// GetBugs returns the Bugs map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetBugs() map[string]string {
if p == nil || p.Bugs == nil {
return map[string]string{}
}
return p.Bugs
}
// GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetCommitOID() string {
if p == nil || p.CommitOID == nil {
return ""
}
return *p.CommitOID
}
// GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetDeletedByID() int64 {
if p == nil || p.DeletedByID == nil {
return 0
}
return *p.DeletedByID
}
// GetDependencies returns the Dependencies map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetDependencies() map[string]string {
if p == nil || p.Dependencies == nil {
return map[string]string{}
}
return p.Dependencies
}
// GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetDescription() string {
if p == nil || p.Description == nil {
return ""
}
return *p.Description
}
// GetDevDependencies returns the DevDependencies map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetDevDependencies() map[string]string {
if p == nil || p.DevDependencies == nil {
return map[string]string{}
}
return p.DevDependencies
}
// GetDirectories returns the Directories map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetDirectories() map[string]string {
if p == nil || p.Directories == nil {
return map[string]string{}
}
return p.Directories
}
// GetDist returns the Dist map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetDist() map[string]string {
if p == nil || p.Dist == nil {
return map[string]string{}
}
return p.Dist
}
// GetEngines returns the Engines map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetEngines() map[string]string {
if p == nil || p.Engines == nil {
return map[string]string{}
}
return p.Engines
}
// GetGitHead returns the GitHead field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetGitHead() string {
if p == nil || p.GitHead == nil {
return ""
}
return *p.GitHead
}
// GetHasShrinkwrap returns the HasShrinkwrap field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetHasShrinkwrap() bool {
if p == nil || p.HasShrinkwrap == nil {
return false
}
return *p.HasShrinkwrap
}
// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetHomepage() string {
if p == nil || p.Homepage == nil {
return ""
}
return *p.Homepage
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetID() string {
if p == nil || p.ID == nil {
return ""
}
return *p.ID
}
// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetInstallationCommand() string {
if p == nil || p.InstallationCommand == nil {
return ""
}
return *p.InstallationCommand
}
// GetLicense returns the License field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetLicense() string {
if p == nil || p.License == nil {
return ""
}
return *p.License
}
// GetMain returns the Main field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetMain() string {
if p == nil || p.Main == nil {
return ""
}
return *p.Main
}
// GetMan returns the Man map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetMan() map[string]any {
if p == nil || p.Man == nil {
return map[string]any{}
}
return p.Man
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetName() string {
if p == nil || p.Name == nil {
return ""
}
return *p.Name
}
// GetNodeVersion returns the NodeVersion field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetNodeVersion() string {
if p == nil || p.NodeVersion == nil {
return ""
}
return *p.NodeVersion
}
// GetNPMUser returns the NPMUser field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetNPMUser() string {
if p == nil || p.NPMUser == nil {
return ""
}
return *p.NPMUser
}
// GetNPMVersion returns the NPMVersion field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetNPMVersion() string {
if p == nil || p.NPMVersion == nil {
return ""
}
return *p.NPMVersion
}
// GetOptionalDependencies returns the OptionalDependencies map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string {
if p == nil || p.OptionalDependencies == nil {
return map[string]string{}
}
return p.OptionalDependencies
}
// GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetPeerDependencies() map[string]string {
if p == nil || p.PeerDependencies == nil {
return map[string]string{}
}
return p.PeerDependencies
}
// GetPublishedViaActions returns the PublishedViaActions field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetPublishedViaActions() bool {
if p == nil || p.PublishedViaActions == nil {
return false
}
return *p.PublishedViaActions
}
// GetReadme returns the Readme field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetReadme() string {
if p == nil || p.Readme == nil {
return ""
}
return *p.Readme
}
// GetReleaseID returns the ReleaseID field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetReleaseID() int64 {
if p == nil || p.ReleaseID == nil {
return 0
}
return *p.ReleaseID
}
// GetRepository returns the Repository map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetRepository() map[string]string {
if p == nil || p.Repository == nil {
return map[string]string{}
}
return p.Repository
}
// GetScripts returns the Scripts map if it's non-nil, an empty map otherwise.
func (p *PackageNPMMetadata) GetScripts() map[string]any {
if p == nil || p.Scripts == nil {
return map[string]any{}
}
return p.Scripts
}
// GetVersion returns the Version field if it's non-nil, zero value otherwise.
func (p *PackageNPMMetadata) GetVersion() string {
if p == nil || p.Version == nil {
return ""
}
return *p.Version
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (p *PackageNugetMetadata) GetName() string {
if p == nil || p.Name == nil {
return ""
}
return *p.Name
}
// GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise.
func (p *PackageRegistry) GetAboutURL() string {
if p == nil || p.AboutURL == nil {
@@ -15998,14 +16574,6 @@ func (p *PackageVersion) GetAuthor() *User {
return p.Author
}
// GetBody returns the Body field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetBody() string {
if p == nil || p.Body == nil {
return ""
}
return *p.Body
}
// GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetBodyHTML() string {
if p == nil || p.BodyHTML == nil {
@@ -16014,6 +16582,14 @@ func (p *PackageVersion) GetBodyHTML() string {
return *p.BodyHTML
}
// GetContainerMetadata returns the ContainerMetadata field.
func (p *PackageVersion) GetContainerMetadata() *PackageEventContainerMetadata {
if p == nil {
return nil
}
return p.ContainerMetadata
}
// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetCreatedAt() Timestamp {
if p == nil || p.CreatedAt == nil {
@@ -16022,6 +16598,22 @@ func (p *PackageVersion) GetCreatedAt() Timestamp {
return *p.CreatedAt
}
// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetDeletedAt() Timestamp {
if p == nil || p.DeletedAt == nil {
return Timestamp{}
}
return *p.DeletedAt
}
// GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetDescription() string {
if p == nil || p.Description == nil {
return ""
}
return *p.Description
}
// GetDraft returns the Draft field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetDraft() bool {
if p == nil || p.Draft == nil {
@@ -16054,6 +16646,14 @@ func (p *PackageVersion) GetInstallationCommand() string {
return *p.InstallationCommand
}
// GetLicense returns the License field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetLicense() string {
if p == nil || p.License == nil {
return ""
}
return *p.License
}
// GetManifest returns the Manifest field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetManifest() string {
if p == nil || p.Manifest == nil {
@@ -16062,14 +16662,6 @@ func (p *PackageVersion) GetManifest() string {
return *p.Manifest
}
// GetMetadata returns the Metadata field.
func (p *PackageVersion) GetMetadata() *PackageMetadata {
if p == nil {
return nil
}
return p.Metadata
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetName() string {
if p == nil || p.Name == nil {
@@ -16078,6 +16670,14 @@ func (p *PackageVersion) GetName() string {
return *p.Name
}
// GetNPMMetadata returns the NPMMetadata field.
func (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata {
if p == nil {
return nil
}
return p.NPMMetadata
}
// GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetPackageHTMLURL() string {
if p == nil || p.PackageHTMLURL == nil {
@@ -16086,6 +16686,14 @@ func (p *PackageVersion) GetPackageHTMLURL() string {
return *p.PackageHTMLURL
}
// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetPackageURL() string {
if p == nil || p.PackageURL == nil {
return ""
}
return *p.PackageURL
}
// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetPrerelease() bool {
if p == nil || p.Prerelease == nil {
@@ -16102,6 +16710,22 @@ func (p *PackageVersion) GetRelease() *PackageRelease {
return p.Release
}
// GetRubyMetadata returns the RubyMetadata map if it's non-nil, an empty map otherwise.
func (p *PackageVersion) GetRubyMetadata() map[string]any {
if p == nil || p.RubyMetadata == nil {
return map[string]any{}
}
return p.RubyMetadata
}
// GetSourceURL returns the SourceURL field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetSourceURL() string {
if p == nil || p.SourceURL == nil {
return ""
}
return *p.SourceURL
}
// GetSummary returns the Summary field if it's non-nil, zero value otherwise.
func (p *PackageVersion) GetSummary() string {
if p == nil || p.Summary == nil {
@@ -16158,6 +16782,78 @@ func (p *PackageVersion) GetVersion() string {
return *p.Version
}
// GetInfo returns the Info field.
func (p *PackageVersionBody) GetInfo() *PackageVersionBodyInfo {
if p == nil {
return nil
}
return p.Info
}
// GetRepo returns the Repo field.
func (p *PackageVersionBody) GetRepo() *Repository {
if p == nil {
return nil
}
return p.Repo
}
// GetCollection returns the Collection field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetCollection() bool {
if p == nil || p.Collection == nil {
return false
}
return *p.Collection
}
// GetMode returns the Mode field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetMode() int64 {
if p == nil || p.Mode == nil {
return 0
}
return *p.Mode
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetName() string {
if p == nil || p.Name == nil {
return ""
}
return *p.Name
}
// GetOID returns the OID field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetOID() string {
if p == nil || p.OID == nil {
return ""
}
return *p.OID
}
// GetPath returns the Path field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetPath() string {
if p == nil || p.Path == nil {
return ""
}
return *p.Path
}
// GetSize returns the Size field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetSize() int64 {
if p == nil || p.Size == nil {
return 0
}
return *p.Size
}
// GetType returns the Type field if it's non-nil, zero value otherwise.
func (p *PackageVersionBodyInfo) GetType() string {
if p == nil || p.Type == nil {
return ""
}
return *p.Type
}
// GetAction returns the Action field if it's non-nil, zero value otherwise.
func (p *Page) GetAction() string {
if p == nil || p.Action == nil {
@@ -16734,6 +17430,38 @@ func (p *PagesUpdate) GetSource() *PagesSource {
return p.Source
}
// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise.
func (p *PagesUpdateWithoutCNAME) GetBuildType() string {
if p == nil || p.BuildType == nil {
return ""
}
return *p.BuildType
}
// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise.
func (p *PagesUpdateWithoutCNAME) GetHTTPSEnforced() bool {
if p == nil || p.HTTPSEnforced == nil {
return false
}
return *p.HTTPSEnforced
}
// GetPublic returns the Public field if it's non-nil, zero value otherwise.
func (p *PagesUpdateWithoutCNAME) GetPublic() bool {
if p == nil || p.Public == nil {
return false
}
return *p.Public
}
// GetSource returns the Source field.
func (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource {
if p == nil {
return nil
}
return p.Source
}
// GetName returns the Name field if it's non-nil, zero value otherwise.
func (p *PatternRuleParameters) GetName() string {
if p == nil || p.Name == nil {
@@ -19310,6 +20038,14 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread {
return p.Thread
}
// GetAutomaticCopilotCodeReviewEnabled returns the AutomaticCopilotCodeReviewEnabled field if it's non-nil, zero value otherwise.
func (p *PullRequestRuleParameters) GetAutomaticCopilotCodeReviewEnabled() bool {
if p == nil || p.AutomaticCopilotCodeReviewEnabled == nil {
return false
}
return *p.AutomaticCopilotCodeReviewEnabled
}
// GetAction returns the Action field if it's non-nil, zero value otherwise.
func (p *PullRequestTargetEvent) GetAction() string {
if p == nil || p.Action == nil {
@@ -20062,6 +20798,14 @@ func (r *Reaction) GetContent() string {
return *r.Content
}
// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (r *Reaction) GetCreatedAt() Timestamp {
if r == nil || r.CreatedAt == nil {
return Timestamp{}
}
return *r.CreatedAt
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (r *Reaction) GetID() int64 {
if r == nil || r.ID == nil {
@@ -23894,6 +24638,46 @@ func (s *ScanningAnalysis) GetWarning() string {
return *s.Warning
}
// GetDisplay returns the Display field if it's non-nil, zero value otherwise.
func (s *SCIMDisplayReference) GetDisplay() string {
if s == nil || s.Display == nil {
return ""
}
return *s.Display
}
// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.
func (s *SCIMGroupAttributes) GetDisplayName() string {
if s == nil || s.DisplayName == nil {
return ""
}
return *s.DisplayName
}
// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.
func (s *SCIMGroupAttributes) GetExternalID() string {
if s == nil || s.ExternalID == nil {
return ""
}
return *s.ExternalID
}
// GetID returns the ID field if it's non-nil, zero value otherwise.
func (s *SCIMGroupAttributes) GetID() string {
if s == nil || s.ID == nil {
return ""
}
return *s.ID
}
// GetMeta returns the Meta field.
func (s *SCIMGroupAttributes) GetMeta() *SCIMMeta {
if s == nil {
return nil
}
return s.Meta
}
// GetCreated returns the Created field if it's non-nil, zero value otherwise.
func (s *SCIMMeta) GetCreated() Timestamp {
if s == nil || s.Created == nil {
@@ -23926,6 +24710,30 @@ func (s *SCIMMeta) GetResourceType() string {
return *s.ResourceType
}
// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise.
func (s *SCIMProvisionedGroups) GetItemsPerPage() int {
if s == nil || s.ItemsPerPage == nil {
return 0
}
return *s.ItemsPerPage
}
// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.
func (s *SCIMProvisionedGroups) GetStartIndex() int {
if s == nil || s.StartIndex == nil {
return 0
}
return *s.StartIndex
}
// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise.
func (s *SCIMProvisionedGroups) GetTotalResults() int {
if s == nil || s.TotalResults == nil {
return 0
}
return *s.TotalResults
}
// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise.
func (s *SCIMProvisionedIdentities) GetItemsPerPage() int {
if s == nil || s.ItemsPerPage == nil {

View File

@@ -19,6 +19,7 @@ import (
"net/http"
"net/url"
"reflect"
"regexp"
"strconv"
"strings"
"sync"
@@ -28,7 +29,7 @@ import (
)
const (
Version = "v69.0.0"
Version = "v71.0.0"
defaultAPIVersion = "2022-11-28"
defaultBaseURL = "https://api.github.com/"
@@ -176,6 +177,10 @@ type Client struct {
rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls.
secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls.
// If specified, Client will block requests for at most this duration in case of reaching a secondary
// rate limit
MaxSecondaryRateLimitRetryAfterDuration time.Duration
// Whether to respect rate limit headers on endpoints that return 302 redirections to artifacts
RateLimitRedirectionalEndpoints bool
@@ -928,6 +933,10 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ
// Update the secondary rate limit if we hit it.
rerr, ok := err.(*AbuseRateLimitError)
if ok && rerr.RetryAfter != nil {
// if a max duration is specified, make sure that we are waiting at most this duration
if c.MaxSecondaryRateLimitRetryAfterDuration > 0 && rerr.GetRetryAfter() > c.MaxSecondaryRateLimitRetryAfterDuration {
rerr.RetryAfter = &c.MaxSecondaryRateLimitRetryAfterDuration
}
c.rateMu.Lock()
c.secondaryRateLimitReset = time.Now().Add(*rerr.RetryAfter)
c.rateMu.Unlock()
@@ -1762,3 +1771,18 @@ type roundTripperFunc func(*http.Request) (*http.Response, error)
func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) {
return fn(r)
}
var runIDFromURLRE = regexp.MustCompile(`repos/.*/actions/runs/(\d+)/deployment_protection_rule$`)
// GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL.
func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) {
match := runIDFromURLRE.FindStringSubmatch(*e.DeploymentCallbackURL)
if len(match) != 2 {
return -1, errors.New("no match")
}
runID, err := strconv.ParseInt(match[1], 10, 64)
if err != nil {
return -1, err
}
return runID, nil
}

View File

@@ -52,6 +52,10 @@ type APIMeta struct {
// GitHub Actions will originate from.
Actions []string `json:"actions,omitempty"`
// An array of IP addresses in CIDR format specifying the IP addresses
// GitHub Action macOS runner will originate from.
ActionsMacos []string `json:"actions_macos,omitempty"`
// An array of IP addresses in CIDR format specifying the IP addresses
// Dependabot will originate from.
Dependabot []string `json:"dependabot,omitempty"`

Some files were not shown because too many files have changed in this diff Show More