Update all dependencies

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-04-17 18:06:38 +03:00
parent 4bedb86cf0
commit d27bd40531
No known key found for this signature in database
GPG key ID: 7D073DCC2C074CB5
231 changed files with 11654 additions and 5870 deletions

View file

@ -19,7 +19,7 @@ jobs:
permissions:
packages: write
name: "Build GARM images"
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
@ -49,4 +49,4 @@ jobs:
--label "org.opencontainers.image.licenses=Apache 2.0" \
--build-arg="GARM_REF=${{ github.event.inputs.ref }}" \
-t ${{ github.event.inputs.push_to_project }}/garm:"${VERSION}" \
--push .
--push .

View file

@ -17,7 +17,7 @@ permissions: {}
jobs:
linters:
name: Linters
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 10
steps:

20
go.mod
View file

@ -6,7 +6,7 @@ toolchain go1.23.6
require (
github.com/BurntSushi/toml v1.5.0
github.com/bradleyfalzon/ghinstallation/v2 v2.14.0
github.com/bradleyfalzon/ghinstallation/v2 v2.15.0
github.com/cloudbase/garm-provider-common v0.1.4
github.com/felixge/httpsnoop v1.0.4
github.com/go-openapi/errors v0.22.1
@ -49,14 +49,14 @@ require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-sql-driver/mysql v1.9.0 // indirect
github.com/go-sql-driver/mysql v1.9.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/google/go-github/v69 v69.2.0 // indirect
github.com/google/go-github/v71 v71.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
@ -68,16 +68,16 @@ require (
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-sqlite3 v1.14.24 // indirect
github.com/mattn/go-sqlite3 v1.14.28 // indirect
github.com/minio/sio v0.4.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.63.0 // indirect
github.com/prometheus/procfs v0.16.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/stretchr/objx v0.5.2 // indirect
@ -87,9 +87,9 @@ require (
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

40
go.sum
View file

@ -6,8 +6,8 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/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/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@ -36,8 +36,8 @@ github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC0
github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo=
github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU=
github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco=
@ -53,8 +53,8 @@ github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDq
github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58=
github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-sql-driver/mysql v1.9.0 h1:Y0zIbQXhQKmQgTp44Y1dp3wTXcn804QoTptLZT1vtvo=
github.com/go-sql-driver/mysql v1.9.0/go.mod h1:pDetrLJeA3oMujJuvXc8RJoasr589B6A9fwzD3QMrqw=
github.com/go-sql-driver/mysql v1.9.2 h1:4cNKDYQ1I84SXslGddlsrMhc8k4LeDVj6Ad6WRjiHuU=
github.com/go-sql-driver/mysql v1.9.2/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
@ -68,8 +68,8 @@ 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/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs=
github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw=
github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE=
github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM=
github.com/google/go-github/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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@ -130,8 +130,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A=
github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA=
github.com/microsoft/go-mssqldb v1.7.2/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA=
github.com/minio/sio v0.4.1 h1:EMe3YBC1nf+sRQia65Rutxi+Z554XPV0dt8BIBA+a/0=
@ -153,12 +153,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k=
github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18=
github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2bbsM=
github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
@ -192,8 +192,8 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
@ -206,8 +206,8 @@ golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 h1:FVCohIoYO7IJoDDVpV2pdq7SgrMH6wHnuTyrdrxJNoY=
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

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,12 +1,6 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 45
maligned:
suggest-new: true
dupl:
threshold: 200
goconst:
@ -16,7 +10,7 @@ linters-settings:
linters:
enable-all: true
disable:
- maligned
- recvcheck
- unparam
- lll
- gochecknoinits
@ -29,9 +23,6 @@ linters:
- wrapcheck
- testpackage
- nlreturn
- gomnd
- exhaustivestruct
- goerr113
- errorlint
- nestif
- godot
@ -39,7 +30,6 @@ linters:
- paralleltest
- tparallel
- thelper
- ifshort
- exhaustruct
- varnamelen
- gci
@ -52,10 +42,15 @@ linters:
- forcetypeassert
- cyclop
# deprecated linters
- deadcode
- interfacer
- scopelint
- varcheck
- structcheck
- golint
- nosnakecase
#- deadcode
#- interfacer
#- scopelint
#- varcheck
#- structcheck
#- golint
#- nosnakecase
#- maligned
#- goerr113
#- ifshort
#- gomnd
#- exhaustivestruct

18
vendor/github.com/go-openapi/jsonpointer/errors.go generated vendored Normal file
View file

@ -0,0 +1,18 @@
package jsonpointer
type pointerError string
func (e pointerError) Error() string {
return string(e)
}
const (
// ErrPointer is an error raised by the jsonpointer package
ErrPointer pointerError = "JSON pointer error"
// ErrInvalidStart states that a JSON pointer must start with a separator ("/")
ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator
// ErrUnsupportedValueType indicates that a value of the wrong type is being set
ErrUnsupportedValueType pointerError = "only structs, pointers, maps and slices are supported for setting values"
)

View file

@ -39,9 +39,6 @@ import (
const (
emptyPointer = ``
pointerSeparator = `/`
invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator
notFound = `Can't find the pointer in the document`
)
var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem()
@ -80,7 +77,7 @@ func (p *Pointer) parse(jsonPointerString string) error {
if jsonPointerString != emptyPointer {
if !strings.HasPrefix(jsonPointerString, pointerSeparator) {
err = errors.New(invalidStart)
err = errors.Join(ErrInvalidStart, ErrPointer)
} else {
referenceTokens := strings.Split(jsonPointerString, pointerSeparator)
p.referenceTokens = append(p.referenceTokens, referenceTokens[1:]...)
@ -128,7 +125,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
rValue := reflect.Indirect(reflect.ValueOf(node))
kind := rValue.Kind()
if isNil(node) {
return nil, kind, fmt.Errorf("nil value has not field %q", decodedToken)
return nil, kind, fmt.Errorf("nil value has no field %q: %w", decodedToken, ErrPointer)
}
switch typed := node.(type) {
@ -146,7 +143,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
return nil, kind, fmt.Errorf("object has no field %q", decodedToken)
return nil, kind, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
return fld.Interface(), kind, nil
@ -158,7 +155,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
if mv.IsValid() {
return mv.Interface(), kind, nil
}
return nil, kind, fmt.Errorf("object has no key %q", decodedToken)
return nil, kind, fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
case reflect.Slice:
tokenIndex, err := strconv.Atoi(decodedToken)
@ -167,14 +164,14 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex)
return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength-1, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
return elem.Interface(), kind, nil
default:
return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken)
return nil, kind, fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@ -194,7 +191,7 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
return fmt.Errorf("object has no field %q", decodedToken)
return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
if fld.IsValid() {
@ -214,18 +211,18 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
if !elem.CanSet() {
return fmt.Errorf("can't set slice index %s to %v", decodedToken, data)
return fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer)
}
elem.Set(reflect.ValueOf(data))
return nil
default:
return fmt.Errorf("invalid token reference %q", decodedToken)
return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@ -244,7 +241,6 @@ func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.K
}
for _, token := range p.referenceTokens {
decodedToken := Unescape(token)
r, knd, err := getSingleImpl(node, decodedToken, nameProvider)
@ -264,7 +260,10 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
knd := reflect.ValueOf(node).Kind()
if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
return errors.New("only structs, pointers, maps and slices are supported for setting values")
return errors.Join(
ErrUnsupportedValueType,
ErrPointer,
)
}
if nameProvider == nil {
@ -307,7 +306,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
return fmt.Errorf("object has no field %q", decodedToken)
return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr {
@ -321,7 +320,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
mv := rValue.MapIndex(kv)
if !mv.IsValid() {
return fmt.Errorf("object has no key %q", decodedToken)
return fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
}
if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr {
node = mv.Addr().Interface()
@ -336,7 +335,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
@ -347,7 +346,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
node = elem.Interface()
default:
return fmt.Errorf("invalid token reference %q", decodedToken)
return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@ -404,10 +403,10 @@ func (p *Pointer) Offset(document string) (int64, error) {
return 0, err
}
default:
return 0, fmt.Errorf("invalid token %#v", tk)
return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
default:
return 0, fmt.Errorf("invalid token %#v", tk)
return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
}
return offset, nil
@ -437,16 +436,16 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) {
return offset, nil
}
default:
return 0, fmt.Errorf("invalid token %#v", tk)
return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
}
return 0, fmt.Errorf("token reference %q not found", decodedToken)
return 0, fmt.Errorf("token reference %q not found: %w", decodedToken, ErrPointer)
}
func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
idx, err := strconv.Atoi(decodedToken)
if err != nil {
return 0, fmt.Errorf("token reference %q is not a number: %v", decodedToken, err)
return 0, fmt.Errorf("token reference %q is not a number: %v: %w", decodedToken, err, ErrPointer)
}
var i int
for i = 0; i < idx && dec.More(); i++ {
@ -470,7 +469,7 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
}
if !dec.More() {
return 0, fmt.Errorf("token reference %q not found", decodedToken)
return 0, fmt.Errorf("token reference %q not found: %w", decodedToken, ErrPointer)
}
return dec.InputOffset(), nil
}

View file

@ -24,6 +24,7 @@ Artur Melanchyk <artur.melanchyk@gmail.com>
Asta Xie <xiemengjun at gmail.com>
B Lamarche <blam413 at gmail.com>
Bes Dollma <bdollma@thousandeyes.com>
Bogdan Constantinescu <bog.con.bc at gmail.com>
Brian Hendriks <brian at dolthub.com>
Bulat Gaifullin <gaifullinbf at gmail.com>
Caine Jette <jette at alum.mit.edu>

View file

@ -1,5 +1,21 @@
# Changelog
## v1.9.2 (2025-04-07)
v1.9.2 is a re-release of v1.9.1 due to a release process issue; no changes were made to the content.
## v1.9.1 (2025-03-21)
### Major Changes
* Add Charset() option. (#1679)
### Bugfixes
* go.mod: fix go version format (#1682)
* Fix FormatDSN missing ConnectionAttributes (#1619)
## v1.9.0 (2025-02-18)
### Major Changes

View file

@ -44,7 +44,6 @@ type Config struct {
DBName string // Database name
Params map[string]string // Connection parameters
ConnectionAttributes string // Connection Attributes, comma-delimited string of user-defined "key:value" pairs
charsets []string // Connection charset. When set, this will be set in SET NAMES <charset> query
Collation string // Connection collation. When set, this will be set in SET NAMES <charset> COLLATE <collation> query
Loc *time.Location // Location for time.Time values
MaxAllowedPacket int // Max packet size allowed
@ -81,6 +80,7 @@ type Config struct {
beforeConnect func(context.Context, *Config) error // Invoked before a connection is established
pubKey *rsa.PublicKey // Server public key
timeTruncate time.Duration // Truncate time.Time values to the specified duration
charsets []string // Connection charset. When set, this will be set in SET NAMES <charset> query
}
// Functional Options Pattern
@ -135,6 +135,21 @@ func EnableCompression(yes bool) Option {
}
}
// Charset sets the connection charset and collation.
//
// charset is the connection charset.
// collation is the connection collation. It can be null or empty string.
//
// When collation is not specified, `SET NAMES <charset>` command is sent when the connection is established.
// When collation is specified, `SET NAMES <charset> COLLATE <collation>` command is sent when the connection is established.
func Charset(charset, collation string) Option {
return func(cfg *Config) error {
cfg.charsets = []string{charset}
cfg.Collation = collation
return nil
}
}
func (cfg *Config) Clone() *Config {
cp := *cfg
if cp.TLS != nil {
@ -307,6 +322,10 @@ func (cfg *Config) FormatDSN() string {
writeDSNParam(&buf, &hasParam, "columnsWithAlias", "true")
}
if cfg.ConnectionAttributes != "" {
writeDSNParam(&buf, &hasParam, "connectionAttributes", url.QueryEscape(cfg.ConnectionAttributes))
}
if cfg.compress {
writeDSNParam(&buf, &hasParam, "compress", "true")
}

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

@ -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

@ -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

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 {

View file

@ -29,7 +29,7 @@ import (
)
const (
Version = "v69.2.0"
Version = "v71.0.0"
defaultAPIVersion = "2022-11-28"
defaultBaseURL = "https://api.github.com/"
@ -1772,7 +1772,7 @@ func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) {
return fn(r)
}
var runIDFromURLRE = regexp.MustCompile(`^repos/.*/actions/runs/(\d+)/deployment_protection_rule$`)
var runIDFromURLRE = regexp.MustCompile(`repos/.*/actions/runs/(\d+)/deployment_protection_rule$`)
// GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL.
func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) {

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