diff --git a/go.mod b/go.mod index 36a2da09..1d6858ca 100644 --- a/go.mod +++ b/go.mod @@ -8,12 +8,12 @@ require ( github.com/bluekeyes/templatetree v0.1.0 github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae github.com/die-net/lrucache v0.0.0-20181227122439-19a39ef22a11 - github.com/google/go-github/v53 v53.2.0 + github.com/google/go-github/v55 v55.0.0 github.com/google/go-querystring v1.1.0 github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 github.com/hashicorp/golang-lru v0.6.0 github.com/palantir/go-baseapp v0.5.2 - github.com/palantir/go-githubapp v0.18.0 + github.com/palantir/go-githubapp v0.19.0 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.30.0 github.com/shurcooL/githubv4 v0.0.0-20230704064427-599ae7bbf278 @@ -29,7 +29,7 @@ require ( github.com/Microsoft/go-winio v0.5.0 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect - github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 // indirect + github.com/bradleyfalzon/ghinstallation/v2 v2.7.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect diff --git a/go.sum b/go.sum index 534834f2..db6f363a 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/DataDog/datadog-go/v5 v5.0.2 h1:UFtEe7662/Qojxkw1d6SboAeA0CPI3naKhVASwFn+04= github.com/DataDog/datadog-go/v5 v5.0.2/go.mod h1:ZI9JFB4ewXbw1sBnF4sxsR2k1H3xjV+PUAOUsHvKpcU= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= @@ -13,8 +12,8 @@ github.com/bluekeyes/hatpear v0.1.1 h1:FA5diKynoYJi6YVTJPEDbe4MG6eA8h+7LYHUlm8bp github.com/bluekeyes/hatpear v0.1.1/go.mod h1:2bh+rl4wLhqzzL0hT7Q4SVGXIivrE8oKgH2WYM3ubt0= github.com/bluekeyes/templatetree v0.1.0 h1:XKehBOS8+QciDUgjQJbqOxOJkZTpXWvZVcPAXDZf2TQ= github.com/bluekeyes/templatetree v0.1.0/go.mod h1:F0jp7CTgfIsYPrplxgA43Ipv/lQG0c75DtpFO98fvAQ= -github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 h1:IRY7Xy588KylkoycsUhFpW7cdGpy5Y5BPsz4IfuJtGk= -github.com/bradleyfalzon/ghinstallation/v2 v2.6.0/go.mod h1:oQ3etOwN3TRH4EwgW5/7MxSVMGlMlzG/O8TU7eYdoSk= +github.com/bradleyfalzon/ghinstallation/v2 v2.7.0 h1:ranXaC3Zz/F6G/f0Joj3LrFp2OzOKfJZev5Q7OaMc88= +github.com/bradleyfalzon/ghinstallation/v2 v2.7.0/go.mod h1:ymxfmloxXBFXvvF1KpeUhOQM6Dfz9NYtfvTiJyk82UE= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae h1:2Zmk+8cNvAGuY8AyvZuWpUdpQUAXwfom4ReVMe/CTIo= @@ -35,16 +34,14 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= -github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= +github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= @@ -66,8 +63,8 @@ github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/palantir/go-baseapp v0.5.2 h1:b1ukx7AXo2/E4NkUvTFlW+185uwCcifzd2XzLrG4oS8= github.com/palantir/go-baseapp v0.5.2/go.mod h1:uijQMPfmgV69oiMu2jkskum/4HiYuEP/gzrnphD+/Co= -github.com/palantir/go-githubapp v0.18.0 h1:t/OEIplGa5BpeUlu3e4S8i1uw3PBrCjV4U6bD5frrL0= -github.com/palantir/go-githubapp v0.18.0/go.mod h1:7NmYdBB0t2fHjmXmI1DyQ2j/mNIemQpp6yvcL12cgSA= +github.com/palantir/go-githubapp v0.19.0 h1:I1U+dMFrnmu4hxxkZybHUD5+EPqqzMkThPzUbuIUFbw= +github.com/palantir/go-githubapp v0.19.0/go.mod h1:IOg1JkjhB6KM2zPq032Nkv9NcToIiuzfW70yWzHdZnE= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -110,7 +107,7 @@ goji.io v2.0.2+incompatible/go.mod h1:sbqFwrtqZACxLBTQcdgVjFh54yGVCvwq8+w49MVMMI golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -121,11 +118,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -144,24 +139,24 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -172,7 +167,6 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pull/github.go b/pull/github.go index 0e26764a..576dde95 100644 --- a/pull/github.go +++ b/pull/github.go @@ -20,7 +20,7 @@ import ( "strings" "time" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/pkg/errors" "github.com/shurcooL/githubv4" ) diff --git a/pull/github_membership.go b/pull/github_membership.go index 63e72214..42821765 100644 --- a/pull/github_membership.go +++ b/pull/github_membership.go @@ -18,7 +18,7 @@ import ( "context" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/pkg/errors" ) diff --git a/pull/github_test.go b/pull/github_test.go index 732fa901..7ec2ed53 100644 --- a/pull/github_test.go +++ b/pull/github_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/shurcooL/githubv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pull/list_teams.go b/pull/list_teams.go index f49002a0..1752f46b 100644 --- a/pull/list_teams.go +++ b/pull/list_teams.go @@ -20,7 +20,7 @@ import ( "net/url" "reflect" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/google/go-querystring/query" ) diff --git a/server/handler/base.go b/server/handler/base.go index 34e34dbe..237ac0ae 100644 --- a/server/handler/base.go +++ b/server/handler/base.go @@ -17,7 +17,7 @@ package handler import ( "context" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-baseapp/baseapp" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" diff --git a/server/handler/check_run.go b/server/handler/check_run.go index beabc2a6..ebb3804d 100644 --- a/server/handler/check_run.go +++ b/server/handler/check_run.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/cross_org.go b/server/handler/cross_org.go index 58375f7b..942184ce 100644 --- a/server/handler/cross_org.go +++ b/server/handler/cross_org.go @@ -18,7 +18,7 @@ import ( "context" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/pull" "github.com/pkg/errors" diff --git a/server/handler/details.go b/server/handler/details.go index 3fabef0d..3128c24a 100644 --- a/server/handler/details.go +++ b/server/handler/details.go @@ -24,7 +24,7 @@ import ( "github.com/alexedwards/scs" "github.com/bluekeyes/templatetree" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/eval_context.go b/server/handler/eval_context.go index f1ecd774..5bab67f0 100644 --- a/server/handler/eval_context.go +++ b/server/handler/eval_context.go @@ -19,7 +19,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/eval_context_reviewers.go b/server/handler/eval_context_reviewers.go index 0e9b4458..e96b4d2c 100644 --- a/server/handler/eval_context_reviewers.go +++ b/server/handler/eval_context_reviewers.go @@ -19,7 +19,7 @@ import ( "math/rand" "time" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/policy/reviewer" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/fetcher.go b/server/handler/fetcher.go index 80c7141d..bc45fd3a 100644 --- a/server/handler/fetcher.go +++ b/server/handler/fetcher.go @@ -17,7 +17,7 @@ package handler import ( "context" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/appconfig" "github.com/palantir/policy-bot/policy" "gopkg.in/yaml.v2" diff --git a/server/handler/installation.go b/server/handler/installation.go index f7091407..96c020a5 100644 --- a/server/handler/installation.go +++ b/server/handler/installation.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/rs/zerolog" diff --git a/server/handler/issue_comment.go b/server/handler/issue_comment.go index 60c32b13..54b6579a 100644 --- a/server/handler/issue_comment.go +++ b/server/handler/issue_comment.go @@ -19,7 +19,7 @@ import ( "encoding/json" "fmt" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/common" diff --git a/server/handler/login.go b/server/handler/login.go index 68d514e8..f211ae3c 100644 --- a/server/handler/login.go +++ b/server/handler/login.go @@ -21,7 +21,7 @@ import ( "github.com/alexedwards/scs" "github.com/bluekeyes/hatpear" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/go-githubapp/oauth2" "github.com/pkg/errors" diff --git a/server/handler/merge_group.go b/server/handler/merge_group.go index a46c76a4..fd49ccca 100644 --- a/server/handler/merge_group.go +++ b/server/handler/merge_group.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/rs/zerolog" diff --git a/server/handler/pull_request.go b/server/handler/pull_request.go index b3c4e590..f42456d3 100644 --- a/server/handler/pull_request.go +++ b/server/handler/pull_request.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" diff --git a/server/handler/pull_request_review.go b/server/handler/pull_request_review.go index fc5159ec..e894e75c 100644 --- a/server/handler/pull_request_review.go +++ b/server/handler/pull_request_review.go @@ -18,7 +18,7 @@ import ( "context" "encoding/json" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy" "github.com/palantir/policy-bot/policy/common" diff --git a/server/handler/status.go b/server/handler/status.go index be6527a3..a76b0fa2 100644 --- a/server/handler/status.go +++ b/server/handler/status.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/palantir/go-githubapp/githubapp" "github.com/palantir/policy-bot/policy/common" "github.com/palantir/policy-bot/pull" @@ -120,8 +120,8 @@ func (h *Status) processOthers(ctx context.Context, event github.StatusEvent) er ownerName, repoName, commitSHA, - &github.PullRequestListOptions{ - ListOptions: github.ListOptions{PerPage: 100}, + &github.ListOptions{ + PerPage: 100, }) if err != nil { return errors.Wrapf(err, "failed to list pull requests for SHA %s", commitSHA) diff --git a/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md b/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md index 9c3071ec..cf5ea50b 100644 --- a/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md +++ b/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md @@ -1,6 +1,6 @@ # ghinstallation -[![GoDoc](https://godoc.org/github.com/bradleyfalzon/ghinstallation?status.svg)](https://godoc.org/github.com/bradleyfalzon/ghinstallation) +[![GoDoc](https://godoc.org/github.com/bradleyfalzon/ghinstallation?status.svg)](https://godoc.org/github.com/bradleyfalzon/ghinstallation/v2) `ghinstallation` provides `Transport`, which implements `http.RoundTripper` to provide authentication as an installation for GitHub Apps. @@ -39,6 +39,8 @@ func main() { } ``` +You can also use [`New()`](https://pkg.go.dev/github.com/bradleyfalzon/ghinstallation/v2#New) to load a key directly from a `[]byte`. + # GitHub Enterprise Example For clients using GitHub Enterprise, set the base URL as follows: diff --git a/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go b/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go index 84012a00..33229ada 100644 --- a/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go +++ b/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go @@ -13,7 +13,7 @@ import ( "sync" "time" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" ) const ( diff --git a/vendor/github.com/google/go-github/v53/github/event.go b/vendor/github.com/google/go-github/v53/github/event.go deleted file mode 100644 index 4ee25603..00000000 --- a/vendor/github.com/google/go-github/v53/github/event.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2018 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "encoding/json" -) - -// Event represents a GitHub event. -type Event struct { - Type *string `json:"type,omitempty"` - Public *bool `json:"public,omitempty"` - RawPayload *json.RawMessage `json:"payload,omitempty"` - Repo *Repository `json:"repo,omitempty"` - Actor *User `json:"actor,omitempty"` - Org *Organization `json:"org,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - ID *string `json:"id,omitempty"` -} - -func (e Event) String() string { - return Stringify(e) -} - -// ParsePayload parses the event payload. For recognized event types, -// a value of the corresponding struct type will be returned. -func (e *Event) ParsePayload() (payload interface{}, err error) { - switch *e.Type { - case "BranchProtectionRuleEvent": - payload = &BranchProtectionRuleEvent{} - case "CheckRunEvent": - payload = &CheckRunEvent{} - case "CheckSuiteEvent": - payload = &CheckSuiteEvent{} - case "CodeScanningAlertEvent": - payload = &CodeScanningAlertEvent{} - case "CommitCommentEvent": - payload = &CommitCommentEvent{} - case "ContentReferenceEvent": - payload = &ContentReferenceEvent{} - case "CreateEvent": - payload = &CreateEvent{} - case "DeleteEvent": - payload = &DeleteEvent{} - case "DeployKeyEvent": - payload = &DeployKeyEvent{} - case "DeploymentEvent": - payload = &DeploymentEvent{} - case "DeploymentProtectionRuleEvent": - payload = &DeploymentProtectionRuleEvent{} - case "DeploymentStatusEvent": - payload = &DeploymentStatusEvent{} - case "DiscussionEvent": - payload = &DiscussionEvent{} - case "DiscussionCommentEvent": - payload = &DiscussionCommentEvent{} - case "ForkEvent": - payload = &ForkEvent{} - case "GitHubAppAuthorizationEvent": - payload = &GitHubAppAuthorizationEvent{} - case "GollumEvent": - payload = &GollumEvent{} - case "InstallationEvent": - payload = &InstallationEvent{} - case "InstallationRepositoriesEvent": - payload = &InstallationRepositoriesEvent{} - case "IssueCommentEvent": - payload = &IssueCommentEvent{} - case "IssuesEvent": - payload = &IssuesEvent{} - case "LabelEvent": - payload = &LabelEvent{} - case "MarketplacePurchaseEvent": - payload = &MarketplacePurchaseEvent{} - case "MemberEvent": - payload = &MemberEvent{} - case "MembershipEvent": - payload = &MembershipEvent{} - case "MergeGroupEvent": - payload = &MergeGroupEvent{} - case "MetaEvent": - payload = &MetaEvent{} - case "MilestoneEvent": - payload = &MilestoneEvent{} - case "OrganizationEvent": - payload = &OrganizationEvent{} - case "OrgBlockEvent": - payload = &OrgBlockEvent{} - case "PackageEvent": - payload = &PackageEvent{} - case "PageBuildEvent": - payload = &PageBuildEvent{} - case "PingEvent": - payload = &PingEvent{} - case "ProjectEvent": - payload = &ProjectEvent{} - case "ProjectCardEvent": - payload = &ProjectCardEvent{} - case "ProjectColumnEvent": - payload = &ProjectColumnEvent{} - case "PublicEvent": - payload = &PublicEvent{} - case "PullRequestEvent": - payload = &PullRequestEvent{} - case "PullRequestReviewEvent": - payload = &PullRequestReviewEvent{} - case "PullRequestReviewCommentEvent": - payload = &PullRequestReviewCommentEvent{} - case "PullRequestReviewThreadEvent": - payload = &PullRequestReviewThreadEvent{} - case "PullRequestTargetEvent": - payload = &PullRequestTargetEvent{} - case "PushEvent": - payload = &PushEvent{} - case "ReleaseEvent": - payload = &ReleaseEvent{} - case "RepositoryEvent": - payload = &RepositoryEvent{} - case "RepositoryDispatchEvent": - payload = &RepositoryDispatchEvent{} - case "RepositoryImportEvent": - payload = &RepositoryImportEvent{} - case "RepositoryVulnerabilityAlertEvent": - payload = &RepositoryVulnerabilityAlertEvent{} - case "SecretScanningAlertEvent": - payload = &SecretScanningAlertEvent{} - case "SecurityAdvisoryEvent": - payload = &SecurityAdvisoryEvent{} - case "StarEvent": - payload = &StarEvent{} - case "StatusEvent": - payload = &StatusEvent{} - case "TeamEvent": - payload = &TeamEvent{} - case "TeamAddEvent": - payload = &TeamAddEvent{} - case "UserEvent": - payload = &UserEvent{} - case "WatchEvent": - payload = &WatchEvent{} - case "WorkflowDispatchEvent": - payload = &WorkflowDispatchEvent{} - case "WorkflowJobEvent": - payload = &WorkflowJobEvent{} - case "WorkflowRunEvent": - payload = &WorkflowRunEvent{} - } - err = json.Unmarshal(*e.RawPayload, &payload) - return payload, err -} - -// Payload returns the parsed event payload. For recognized event types, -// a value of the corresponding struct type will be returned. -// -// Deprecated: Use ParsePayload instead, which returns an error -// rather than panics if JSON unmarshaling raw payload fails. -func (e *Event) Payload() (payload interface{}) { - var err error - payload, err = e.ParsePayload() - if err != nil { - panic(err) - } - return payload -} diff --git a/vendor/github.com/google/go-github/v53/AUTHORS b/vendor/github.com/google/go-github/v55/AUTHORS similarity index 89% rename from vendor/github.com/google/go-github/v53/AUTHORS rename to vendor/github.com/google/go-github/v55/AUTHORS index 5e40cd1f..74a21dc6 100644 --- a/vendor/github.com/google/go-github/v53/AUTHORS +++ b/vendor/github.com/google/go-github/v55/AUTHORS @@ -11,13 +11,17 @@ 178inaba 2BFL 413x +6543 <6543@obermui.de> Abed Kibbe Abhinav Gupta Abhishek Veeramalla aboy +Adam Kohring adrienzieba afdesk +Ahmad Nurus S Ahmed Hagy +Aidan Aidan Steele Ainsley Chong ajz01 @@ -26,6 +30,7 @@ Akhil Mohan Alec Thomas Aleks Clark Alex Bramley +Alex Ellis Alex Orr Alex Su Alex Unger @@ -51,6 +56,7 @@ Anton Nguyen Anubha Kushwaha appilon aprp +apurwaj2 Aravind Arda Kuyumcu Arıl Bozoluk @@ -60,12 +66,15 @@ Austin Dizzy Azuka Okuleye Ben Batha Benjamen Keroack +Berkay Tacyildiz Beshr Kayali Beyang Liu Billy Keyes Billy Lynch +Bingtan Lu Bjorn Neergaard Björn Häuser +Bo Huang boljen Bracken Brad Harris @@ -74,6 +83,7 @@ Bradley Falzon Bradley McAllister Brandon Butler Brandon Cook +Brandon Stubbs Brett Kuhlman Brett Logan Brian Egizi @@ -96,6 +106,7 @@ Chris Schaefer chrisforrette Christian Bargmann Christian Muehlhaeuser +Christoph Jerolimov Christoph Sassenberg CI Monk Colin Misare @@ -125,12 +136,14 @@ Derek Jobst DeviousLab Dhi Aurrahman Diego Lapiduz +Diogo Vilela Dmitri Shuralyov dmnlk Don Petersen Doug Turner Drew Fradette Dustin Deus +Dustin Lish Eivind Eli Uriegas Elliott Beach @@ -141,10 +154,12 @@ eperm Erick Fejta Erik Nobel erwinvaneyk +Evan Anderson Evan Elias Fabian Holler Fabrice Fatema-Moaiyadi +Federico Di Pierro Felix Geisendörfer Filippo Valsorda Florian Forster @@ -155,6 +170,7 @@ Francisco Guimarães François de Metz Fredrik Jönsson Gabriel +Gal Ofri Garrett Squire George Kontridze Georgy Buranov @@ -163,6 +179,7 @@ Gnahz Google Inc. Grachev Mikhail griffin_stewie +guangwu Guillaume Jacquet Guz Alexander Guðmundur Bjarni Ólafsson @@ -178,6 +195,7 @@ huydx i2bskn Iain Steers Ikko Ashimine +Ilia Choly Ioannis Georgoulas Isao Jonas ishan upadhyay @@ -189,11 +207,15 @@ Jameel Haffejee James Bowes James Cockbain James Loh +James Maguire +James Turley Jamie West Jan Kosecki Jan Švábík +Jason Field Javier Campanini Jef LeCompte +Jeff Wenzbauer Jens Rantil Jeremy Morris Jesse Haka @@ -208,7 +230,9 @@ John Engelman John Jones John Liu Jordan Brockopp +Jordan Burandt Jordan Sussman +Jorge Gómez Reus Joshua Bezaleel Abednego João Cerqueira JP Phillips @@ -222,14 +246,17 @@ Justin Abrahms Justin Toh Jusung Lee jzhoucliqr +k0ral k1rnt kadern0 +Karthik Sundari Katrina Owen Kautilya Tripathi Keita Urashima Kevin Burke Kevin Wang Kevin Zhao +kgalli Kirill Konrad Malawski Kookheon Kwon @@ -239,19 +266,24 @@ Kshitij Saraogi Kumar Saurabh Kyle Kurz kyokomi +Lars Lehtonen Laurent Verdoïa leopoldwang Liam Galvin Lluis Campos Lovro Mažgon +Loïs Postula Luca Campese Lucas Alcantara +Lucas Martin-King Luis Davim Luke Evers +Luke Hinds Luke Kysow Luke Roberts Luke Young lynn [they] +Magnus Kulke Maksim Zhylinski Marc Binder Marcelo Carlos @@ -266,9 +298,11 @@ Matija Horvat Matin Rahmanian Matt Matt Brender +Matt Dainty Matt Gaunt Matt Landis Matt Moore +Matt Simons Maxime Bury Michael Meng Michael Spiegel @@ -277,26 +311,33 @@ Michał Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili Mukundan Senthil Munia Balayil Mustafa Abban Nadav Kaner +Naoki Kanatani Nathan VanBenschoten Navaneeth Suresh +Neal Caffery Neil O'Toole Nick Miyake Nick Platt Nick Spragg +Nicolas Chapurlat Nikhita Raghunath Nilesh Singh Noah Hanjun Lee Noah Zoschke ns-cweber +nxya Ole Orhagen Oleg Kovalov Ondřej Kupka Ori Talmor +Osama Faqhruldin +oslowalk Pablo Pérez Schröder Palash Nigam Panagiotis Moustafellos @@ -307,6 +348,7 @@ parkhyukjun89 Pat Alwell Patrick DeVivo Patrick Marabeas +Patrik Nordlén Pavel Dvoinos Pavel Shtanko Pete Wagner @@ -323,6 +365,7 @@ Quinn Slack Rackspace US, Inc. Radek Simko Radliński Ignacy +Rafael Aramizu Gomes Rajat Jindal Rajendra arora Rajkumar @@ -351,6 +394,7 @@ Ryo Nakao Saaarah Safwan Olaimat Sahil Dua +Sai Ravi Teja Chintakrindi saisi Sam Minnée Sandeep Sukhani @@ -377,6 +421,7 @@ Sho Okada Shrikrishna Singh Simon Davis sona-tar +soniachikh SoundCloud, Ltd. Sridhar Mocherla SriVignessh Pss @@ -387,6 +432,7 @@ Suhaib Mujahid sushmita wable Szymon Kodrebski Søren Hansen +T.J. Corrigan Takashi Yoneuchi Takayuki Watanabe Taketoshi Fujiwara @@ -398,6 +444,7 @@ Theofilos Petsios Thomas Aidan Curran Thomas Bruyelle Tim Rogers +Timothy O'Brien Timothée Peignier Tingluo Huang tkhandel @@ -410,11 +457,15 @@ Vaibhav Singh Varadarajan Aravamudhan Victor Castell Victor Vrantchan +Victory Osikwemhe vikkyomkar +Vivek Vlad Ungureanu Wasim Thabraze Weslei Juan Moser Pereira +Wheeler Law Will Maier +Will Norris Willem D'Haeseleer William Bailey William Cooke @@ -422,12 +473,15 @@ Xabi xibz Yann Malet Yannick Utard +Yarden Shoham Yicheng Qin Yosuke Akatsuka Yumikiyo Osanai +Yurii Soldak Yusef Mohamadi Yusuke Kuoka Zach Latta zhouhaibing089 六开箱 缘生 +蒋航 diff --git a/vendor/github.com/google/go-github/v53/LICENSE b/vendor/github.com/google/go-github/v55/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v53/LICENSE rename to vendor/github.com/google/go-github/v55/LICENSE diff --git a/vendor/github.com/google/go-github/v53/github/actions.go b/vendor/github.com/google/go-github/v55/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions.go rename to vendor/github.com/google/go-github/v55/github/actions.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_artifacts.go b/vendor/github.com/google/go-github/v55/github/actions_artifacts.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v55/github/actions_artifacts.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_cache.go b/vendor/github.com/google/go-github/v55/github/actions_cache.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_cache.go rename to vendor/github.com/google/go-github/v55/github/actions_cache.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_oidc.go b/vendor/github.com/google/go-github/v55/github/actions_oidc.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_oidc.go rename to vendor/github.com/google/go-github/v55/github/actions_oidc.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_required_workflows.go b/vendor/github.com/google/go-github/v55/github/actions_required_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_required_workflows.go rename to vendor/github.com/google/go-github/v55/github/actions_required_workflows.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v55/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v55/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_runners.go b/vendor/github.com/google/go-github/v55/github/actions_runners.go similarity index 99% rename from vendor/github.com/google/go-github/v53/github/actions_runners.go rename to vendor/github.com/google/go-github/v55/github/actions_runners.go index 3990a5a9..7427451c 100644 --- a/vendor/github.com/google/go-github/v53/github/actions_runners.go +++ b/vendor/github.com/google/go-github/v55/github/actions_runners.go @@ -58,6 +58,7 @@ type GenerateJITConfigRequest struct { // JITRunnerConfig represents encoded JIT configuration that can be used to bootstrap a self-hosted runner. type JITRunnerConfig struct { + Runner *Runner `json:"runner,omitempty"` EncodedJITConfig *string `json:"encoded_jit_config,omitempty"` } diff --git a/vendor/github.com/google/go-github/v53/github/actions_secrets.go b/vendor/github.com/google/go-github/v55/github/actions_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_secrets.go rename to vendor/github.com/google/go-github/v55/github/actions_secrets.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_variables.go b/vendor/github.com/google/go-github/v55/github/actions_variables.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_variables.go rename to vendor/github.com/google/go-github/v55/github/actions_variables.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v55/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v55/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v53/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v55/github/actions_workflow_runs.go similarity index 99% rename from vendor/github.com/google/go-github/v53/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v55/github/actions_workflow_runs.go index 61f736be..00221086 100644 --- a/vendor/github.com/google/go-github/v53/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v55/github/actions_workflow_runs.go @@ -46,6 +46,7 @@ type WorkflowRun struct { Repository *Repository `json:"repository,omitempty"` HeadRepository *Repository `json:"head_repository,omitempty"` Actor *User `json:"actor,omitempty"` + TriggeringActor *User `json:"triggering_actor,omitempty"` } // WorkflowRuns represents a slice of repository action workflow run. diff --git a/vendor/github.com/google/go-github/v53/github/actions_workflows.go b/vendor/github.com/google/go-github/v55/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/actions_workflows.go rename to vendor/github.com/google/go-github/v55/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v53/github/activity.go b/vendor/github.com/google/go-github/v55/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/activity.go rename to vendor/github.com/google/go-github/v55/github/activity.go diff --git a/vendor/github.com/google/go-github/v53/github/activity_events.go b/vendor/github.com/google/go-github/v55/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/activity_events.go rename to vendor/github.com/google/go-github/v55/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v53/github/activity_notifications.go b/vendor/github.com/google/go-github/v55/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/activity_notifications.go rename to vendor/github.com/google/go-github/v55/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v53/github/activity_star.go b/vendor/github.com/google/go-github/v55/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/activity_star.go rename to vendor/github.com/google/go-github/v55/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v53/github/activity_watching.go b/vendor/github.com/google/go-github/v55/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/activity_watching.go rename to vendor/github.com/google/go-github/v55/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v53/github/admin.go b/vendor/github.com/google/go-github/v55/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/admin.go rename to vendor/github.com/google/go-github/v55/github/admin.go diff --git a/vendor/github.com/google/go-github/v53/github/admin_orgs.go b/vendor/github.com/google/go-github/v55/github/admin_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/admin_orgs.go rename to vendor/github.com/google/go-github/v55/github/admin_orgs.go diff --git a/vendor/github.com/google/go-github/v53/github/admin_stats.go b/vendor/github.com/google/go-github/v55/github/admin_stats.go similarity index 99% rename from vendor/github.com/google/go-github/v53/github/admin_stats.go rename to vendor/github.com/google/go-github/v55/github/admin_stats.go index ef294f44..17e568f6 100644 --- a/vendor/github.com/google/go-github/v53/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v55/github/admin_stats.go @@ -7,7 +7,6 @@ package github import ( "context" - "fmt" ) // AdminStats represents a variety of stats of a GitHub Enterprise @@ -155,7 +154,7 @@ func (s RepoStats) String() string { // // GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/admin_stats/ func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { - u := fmt.Sprintf("enterprise/stats/all") + u := "enterprise/stats/all" req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v53/github/admin_users.go b/vendor/github.com/google/go-github/v55/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/admin_users.go rename to vendor/github.com/google/go-github/v55/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v53/github/apps.go b/vendor/github.com/google/go-github/v55/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/apps.go rename to vendor/github.com/google/go-github/v55/github/apps.go diff --git a/vendor/github.com/google/go-github/v53/github/apps_hooks.go b/vendor/github.com/google/go-github/v55/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/apps_hooks.go rename to vendor/github.com/google/go-github/v55/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v53/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v55/github/apps_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v55/github/apps_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v53/github/apps_installation.go b/vendor/github.com/google/go-github/v55/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/apps_installation.go rename to vendor/github.com/google/go-github/v55/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v53/github/apps_manifest.go b/vendor/github.com/google/go-github/v55/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/apps_manifest.go rename to vendor/github.com/google/go-github/v55/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v53/github/apps_marketplace.go b/vendor/github.com/google/go-github/v55/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v55/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v53/github/authorizations.go b/vendor/github.com/google/go-github/v55/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/authorizations.go rename to vendor/github.com/google/go-github/v55/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v53/github/billing.go b/vendor/github.com/google/go-github/v55/github/billing.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/billing.go rename to vendor/github.com/google/go-github/v55/github/billing.go diff --git a/vendor/github.com/google/go-github/v53/github/checks.go b/vendor/github.com/google/go-github/v55/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/checks.go rename to vendor/github.com/google/go-github/v55/github/checks.go diff --git a/vendor/github.com/google/go-github/v53/github/code-scanning.go b/vendor/github.com/google/go-github/v55/github/code-scanning.go similarity index 69% rename from vendor/github.com/google/go-github/v53/github/code-scanning.go rename to vendor/github.com/google/go-github/v55/github/code-scanning.go index e4a6abeb..0ae269be 100644 --- a/vendor/github.com/google/go-github/v53/github/code-scanning.go +++ b/vendor/github.com/google/go-github/v55/github/code-scanning.go @@ -48,11 +48,13 @@ type Message struct { type MostRecentInstance struct { Ref *string `json:"ref,omitempty"` AnalysisKey *string `json:"analysis_key,omitempty"` + Category *string `json:"category,omitempty"` Environment *string `json:"environment,omitempty"` State *string `json:"state,omitempty"` CommitSHA *string `json:"commit_sha,omitempty"` Message *Message `json:"message,omitempty"` Location *Location `json:"location,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` Classifications []string `json:"classifications,omitempty"` } @@ -113,15 +115,30 @@ func (a *Alert) ID() int64 { return id } -// AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts -// method. +// AlertInstancesListOptions specifies optional parameters to the CodeScanningService.ListAlertInstances method. +type AlertInstancesListOptions struct { + // Return code scanning alert instances for a specific branch reference. + // The ref can be formatted as refs/heads/ or simply . To reference a pull request use refs/pull//merge + Ref string `url:"ref,omitempty"` + + ListOptions +} + +// AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts method. type AlertListOptions struct { // State of the code scanning alerts to list. Set to closed to list only closed code scanning alerts. Default: open State string `url:"state,omitempty"` - // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. + // Return code scanning alerts for a specific branch reference. + // The ref can be formatted as refs/heads/ or simply . To reference a pull request use refs/pull//merge Ref string `url:"ref,omitempty"` + // If specified, only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error. + Severity string `url:"severity,omitempty"` + + // The name of a code scanning tool. Only results by this tool will be listed. + ToolName string `url:"tool_name,omitempty"` + ListCursorOptions // Add ListOptions so offset pagination with integer type "page" query parameter is accepted @@ -134,12 +151,28 @@ type AnalysesListOptions struct { // Return code scanning analyses belonging to the same SARIF upload. SarifID *string `url:"sarif_id,omitempty"` - // Return code scanning analyses for a specific branch reference. The ref can be formatted as refs/heads/ or simply . + // Return code scanning analyses for a specific branch reference. + // The ref can be formatted as refs/heads/ or simply . To reference a pull request use refs/pull//merge Ref *string `url:"ref,omitempty"` ListOptions } +// CodeQLDatabase represents a metadata about the CodeQL database. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning +type CodeQLDatabase struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Language *string `json:"language,omitempty"` + Uploader *User `json:"uploader,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Size *int64 `json:"size,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` +} + // ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. // // GitHub API docs: https://docs.github.com/en/rest/code-scanning @@ -202,7 +235,7 @@ type SarifID struct { // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-an-organization +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("orgs/%v/code-scanning/alerts", org) u, err := addOptions(u, opts) @@ -230,7 +263,7 @@ func (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts", owner, repo) u, err := addOptions(u, opts) @@ -259,7 +292,7 @@ func (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo // // The security alert_id is the number at the end of the security alert's URL. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-alert +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v", owner, repo, id) @@ -302,13 +335,40 @@ func (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo strin return a, resp, nil } +// ListAlertInstances lists instances of a code scanning alert. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +func (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/alerts/%v/instances", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var alertInstances []*MostRecentInstance + resp, err := s.client.Do(ctx, req, &alertInstances) + if err != nil { + return nil, resp, err + } + + return alertInstances, resp, nil +} + // UploadSarif uploads the result of code scanning job to GitHub. // // For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string. // You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events // write permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) @@ -326,13 +386,45 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin return sarifID, resp, nil } +// SARIFUpload represents information about a SARIF upload. +type SARIFUpload struct { + // `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. + // `failed` files have either not been processed at all, or could only be partially processed. + ProcessingStatus *string `json:"processing_status,omitempty"` + // The REST API URL for getting the analyses associated with the upload. + AnalysesURL *string `json:"analyses_url,omitempty"` +} + +// GetSARIF gets information about a SARIF upload. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +func (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs/%v", owner, repo, sarifID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + sarifUpload := new(SARIFUpload) + resp, err := s.client.Do(ctx, req, sarifUpload) + if err != nil { + return nil, resp, err + } + + return sarifUpload, resp, nil +} + // ListAnalysesForRepo lists code scanning analyses for a repository. // // Lists the details of all code scanning analyses for a repository, starting with the most recent. // You must use an access token with the security_events scope to use this endpoint. // GitHub Apps must have the security_events read permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#list-code-scanning-analyses-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) u, err := addOptions(u, opts) @@ -361,7 +453,7 @@ func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, re // // The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-analysis-for-a-repository +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) @@ -379,6 +471,85 @@ func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo strin return analysis, resp, nil } +// DeleteAnalysis represents a successful deletion of a code scanning analysis. +type DeleteAnalysis struct { + // Next deletable analysis in chain, without last analysis deletion confirmation + NextAnalysisURL *string `json:"next_analysis_url,omitempty"` + // Next deletable analysis in chain, with last analysis deletion confirmation + ConfirmDeleteURL *string `json:"confirm_delete_url,omitempty"` +} + +// DeleteAnalysis deletes a single code scanning analysis from a repository. +// +// You must use an access token with the repo scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +func (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + deleteAnalysis := new(DeleteAnalysis) + resp, err := s.client.Do(ctx, req, deleteAnalysis) + if err != nil { + return nil, resp, err + } + + return deleteAnalysis, resp, nil +} + +// ListCodeQLDatabases lists the CodeQL databases that are available in a repository. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the contents read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +func (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var codeqlDatabases []*CodeQLDatabase + resp, err := s.client.Do(ctx, req, &codeqlDatabases) + if err != nil { + return nil, resp, err + } + + return codeqlDatabases, resp, nil +} + +// GetCodeQLDatabase gets a CodeQL database for a language in a repository. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the contents read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +func (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/codeql/databases/%v", owner, repo, language) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + codeqlDatabase := new(CodeQLDatabase) + resp, err := s.client.Do(ctx, req, codeqlDatabase) + if err != nil { + return nil, resp, err + } + + return codeqlDatabase, resp, nil +} + // DefaultSetupConfiguration represents a code scanning default setup configuration. type DefaultSetupConfiguration struct { State *string `json:"state,omitempty"` @@ -393,7 +564,7 @@ type DefaultSetupConfiguration struct { // endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write // permission to use this endpoint. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#get-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration func (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) @@ -434,7 +605,7 @@ type UpdateDefaultSetupConfigurationResponse struct { // This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub // returns to signify that it has now scheduled the update of the pull request branch in a background task. // -// GitHub API docs: https://docs.github.com/en/rest/code-scanning#update-a-code-scanning-default-setup-configuration +// GitHub API docs: https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration func (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) { u := fmt.Sprintf("repos/%s/%s/code-scanning/default-setup", owner, repo) diff --git a/vendor/github.com/google/go-github/v53/github/codespaces.go b/vendor/github.com/google/go-github/v55/github/codespaces.go similarity index 99% rename from vendor/github.com/google/go-github/v53/github/codespaces.go rename to vendor/github.com/google/go-github/v55/github/codespaces.go index a260c227..cd8b0e5b 100644 --- a/vendor/github.com/google/go-github/v53/github/codespaces.go +++ b/vendor/github.com/google/go-github/v55/github/codespaces.go @@ -126,7 +126,7 @@ type ListCodespacesOptions struct { // // GitHub API docs: https://docs.github.com/en/rest/codespaces/codespaces?apiVersion=2022-11-28#list-codespaces-for-the-authenticated-user func (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) { - u := fmt.Sprint("user/codespaces") + u := "user/codespaces" u, err := addOptions(u, opts) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v53/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v55/github/codespaces_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v55/github/codespaces_secrets.go diff --git a/vendor/github.com/google/go-github/v53/github/dependabot.go b/vendor/github.com/google/go-github/v55/github/dependabot.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/dependabot.go rename to vendor/github.com/google/go-github/v55/github/dependabot.go diff --git a/vendor/github.com/google/go-github/v53/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v55/github/dependabot_alerts.go similarity index 93% rename from vendor/github.com/google/go-github/v53/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v55/github/dependabot_alerts.go index 7b5d53b3..177316b1 100644 --- a/vendor/github.com/google/go-github/v53/github/dependabot_alerts.go +++ b/vendor/github.com/google/go-github/v55/github/dependabot_alerts.go @@ -17,8 +17,8 @@ type Dependency struct { Scope *string `json:"scope,omitempty"` } -// AdvisoryCVSs represents the advisory pertaining to the Common Vulnerability Scoring System. -type AdvisoryCVSs struct { +// AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System. +type AdvisoryCVSS struct { Score *float64 `json:"score,omitempty"` VectorString *string `json:"vector_string,omitempty"` } @@ -37,7 +37,7 @@ type DependabotSecurityAdvisory struct { Description *string `json:"description,omitempty"` Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"` Severity *string `json:"severity,omitempty"` - CVSs *AdvisoryCVSs `json:"cvss,omitempty"` + CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` References []*AdvisoryReference `json:"references,omitempty"` @@ -62,7 +62,9 @@ type DependabotAlert struct { DismissedReason *string `json:"dismissed_reason,omitempty"` DismissedComment *string `json:"dismissed_comment,omitempty"` FixedAt *Timestamp `json:"fixed_at,omitempty"` - Repository *Repository `json:"repository,omitempty"` + AutoDismissedAt *Timestamp `json:"auto_dismissed_at,omitempty"` + // The repository is always empty for events + Repository *Repository `json:"repository,omitempty"` } // ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts @@ -76,6 +78,7 @@ type ListAlertsOptions struct { Sort *string `url:"sort,omitempty"` Direction *string `url:"direction,omitempty"` + ListOptions ListCursorOptions } diff --git a/vendor/github.com/google/go-github/v53/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v55/github/dependabot_secrets.go similarity index 95% rename from vendor/github.com/google/go-github/v53/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v55/github/dependabot_secrets.go index f87ab42c..685f7bea 100644 --- a/vendor/github.com/google/go-github/v53/github/dependabot_secrets.go +++ b/vendor/github.com/google/go-github/v55/github/dependabot_secrets.go @@ -144,8 +144,25 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { + repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) + for i, secret := range eSecret.SelectedRepositoryIDs { + repoIDs[i] = fmt.Sprintf("%v", secret) + } + params := struct { + *DependabotEncryptedSecret + SelectedRepositoryIDs []string `json:"selected_repository_ids,omitempty"` + }{ + DependabotEncryptedSecret: eSecret, + SelectedRepositoryIDs: repoIDs, + } + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) - return s.putSecret(ctx, url, eSecret) + req, err := s.client.NewRequest("PUT", url, params) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) } func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v55/github/dependency_graph.go b/vendor/github.com/google/go-github/v55/github/dependency_graph.go new file mode 100644 index 00000000..e578965c --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/dependency_graph.go @@ -0,0 +1,80 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +type DependencyGraphService service + +// SBOM represents a software bill of materials, which describes the +// packages/libraries that a repository depends on. +type SBOM struct { + SBOM *SBOMInfo `json:"sbom,omitempty"` +} + +// CreationInfo represents when the SBOM was created and who created it. +type CreationInfo struct { + Created *Timestamp `json:"created,omitempty"` + Creators []string `json:"creators,omitempty"` +} + +// RepoDependencies represents the dependencies of a repo. +type RepoDependencies struct { + SPDXID *string `json:"SPDXID,omitempty"` + // Package name + Name *string `json:"name,omitempty"` + VersionInfo *string `json:"versionInfo,omitempty"` + DownloadLocation *string `json:"downloadLocation,omitempty"` + FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` + LicenseConcluded *string `json:"licenseConcluded,omitempty"` + LicenseDeclared *string `json:"licenseDeclared,omitempty"` +} + +// SBOMInfo represents a software bill of materials (SBOM) using SPDX. +// SPDX is an open standard for SBOMs that +// identifies and catalogs components, licenses, copyrights, security +// references, and other metadata relating to software. +type SBOMInfo struct { + SPDXID *string `json:"SPDXID,omitempty"` + SPDXVersion *string `json:"spdxVersion,omitempty"` + CreationInfo *CreationInfo `json:"creationInfo,omitempty"` + + // Repo name + Name *string `json:"name,omitempty"` + DataLicense *string `json:"dataLicense,omitempty"` + DocumentDescribes []string `json:"documentDescribes,omitempty"` + DocumentNamespace *string `json:"documentNamespace,omitempty"` + + // List of packages dependencies + Packages []*RepoDependencies `json:"packages,omitempty"` +} + +func (s SBOM) String() string { + return Stringify(s) +} + +// GetSBOM fetches the software bill of materials for a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/dependency-graph/sboms +func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var sbom *SBOM + resp, err := s.client.Do(ctx, req, &sbom) + if err != nil { + return nil, resp, err + } + + return sbom, resp, nil +} diff --git a/vendor/github.com/google/go-github/v53/github/doc.go b/vendor/github.com/google/go-github/v55/github/doc.go similarity index 87% rename from vendor/github.com/google/go-github/v53/github/doc.go rename to vendor/github.com/google/go-github/v55/github/doc.go index af284711..bace6fb3 100644 --- a/vendor/github.com/google/go-github/v53/github/doc.go +++ b/vendor/github.com/google/go-github/v55/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v53/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v55/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to @@ -40,34 +40,16 @@ For more sample code snippets, head over to the https://github.com/google/go-git # Authentication -The go-github library does not directly handle authentication. Instead, when -creating a new client, pass an http.Client that can handle authentication for -you. The easiest and recommended way to do this is using the golang.org/x/oauth2 -library, but you can always use any other library that provides an http.Client. -If you have an OAuth2 access token (for example, a personal API token), you can -use it with the oauth2 library using: +Use Client.WithAuthToken to configure your client to authenticate using an Oauth token +(for example, a personal access token). This is what is needed for a majority of use cases +aside from GitHub Apps. - import "golang.org/x/oauth2" - - func main() { - ctx := context.Background() - ts := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: "... your access token ..."}, - ) - tc := oauth2.NewClient(ctx, ts) - - client := github.NewClient(tc) - - // list all repositories for the authenticated user - repos, _, err := client.Repositories.List(ctx, "", nil) - } + client := github.NewClient(nil).WithAuthToken("... your access token ...") Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. -See the oauth2 docs for complete instructions on using that library. - For API methods that require HTTP Basic Authentication, use the BasicAuthTransport. diff --git a/vendor/github.com/google/go-github/v53/github/enterprise.go b/vendor/github.com/google/go-github/v55/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/enterprise.go rename to vendor/github.com/google/go-github/v55/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v53/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v55/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v55/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v53/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v55/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v55/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v53/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v55/github/enterprise_code_security_and_analysis.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v55/github/enterprise_code_security_and_analysis.go diff --git a/vendor/github.com/google/go-github/v55/github/event.go b/vendor/github.com/google/go-github/v55/github/event.go new file mode 100644 index 00000000..e98606bc --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/event.go @@ -0,0 +1,54 @@ +// Copyright 2018 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "encoding/json" +) + +// Event represents a GitHub event. +type Event struct { + Type *string `json:"type,omitempty"` + Public *bool `json:"public,omitempty"` + RawPayload *json.RawMessage `json:"payload,omitempty"` + Repo *Repository `json:"repo,omitempty"` + Actor *User `json:"actor,omitempty"` + Org *Organization `json:"org,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + ID *string `json:"id,omitempty"` +} + +func (e Event) String() string { + return Stringify(e) +} + +// ParsePayload parses the event payload. For recognized event types, +// a value of the corresponding struct type will be returned. +func (e *Event) ParsePayload() (interface{}, error) { + // It would be nice if e.Type were the snake_case name of the event, + // but the existing interface uses the struct name instead. + payload := EventForType(typeToMessageMapping[e.GetType()]) + + if err := json.Unmarshal(e.GetRawPayload(), &payload); err != nil { + return nil, err + } + + return payload, nil +} + +// Payload returns the parsed event payload. For recognized event types, +// a value of the corresponding struct type will be returned. +// +// Deprecated: Use ParsePayload instead, which returns an error +// rather than panics if JSON unmarshaling raw payload fails. +func (e *Event) Payload() (payload interface{}) { + var err error + payload, err = e.ParsePayload() + if err != nil { + panic(err) + } + return payload +} diff --git a/vendor/github.com/google/go-github/v53/github/event_types.go b/vendor/github.com/google/go-github/v55/github/event_types.go similarity index 85% rename from vendor/github.com/google/go-github/v53/github/event_types.go rename to vendor/github.com/google/go-github/v55/github/event_types.go index 6a13b286..1a403da9 100644 --- a/vendor/github.com/google/go-github/v53/github/event_types.go +++ b/vendor/github.com/google/go-github/v55/github/event_types.go @@ -134,6 +134,25 @@ type DeleteEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. +// The Webhook event name is "dependabot_alert". +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert +type DependabotAlertEvent struct { + Action *string `json:"action,omitempty"` + Alert *DependabotAlert `json:"alert,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` +} + // DeployKeyEvent is triggered when a deploy key is added or removed from a repository. // The Webhook event name is "deploy_key". // @@ -165,8 +184,10 @@ type DeployKeyEvent struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#deployment type DeploymentEvent struct { - Deployment *Deployment `json:"deployment,omitempty"` - Repo *Repository `json:"repository,omitempty"` + Deployment *Deployment `json:"deployment,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Workflow *Workflow `json:"workflow,omitempty"` + WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` @@ -505,6 +526,38 @@ type InstallationRepositoriesEvent struct { Installation *Installation `json:"installation,omitempty"` } +// InstallationLoginChange represents a change in login on an installation. +type InstallationLoginChange struct { + From *string `json:"from,omitempty"` +} + +// InstallationSlugChange represents a change in slug on an installation. +type InstallationSlugChange struct { + From *string `json:"from,omitempty"` +} + +// InstallationChanges represents a change in slug or login on an installation. +type InstallationChanges struct { + Login *InstallationLoginChange `json:"login,omitempty"` + Slug *InstallationSlugChange `json:"slug,omitempty"` +} + +// InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account. +// The Webhook event name is "installation_target". +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target +type InstallationTargetEvent struct { + Account *User `json:"account,omitempty"` + Action *string `json:"action,omitempty"` + Changes *InstallationChanges `json:"changes,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + TargetType *string `json:"target_type,omitempty"` +} + // IssueCommentEvent is triggered when an issue comment is created on an issue // or pull request. // The Webhook event name is "issue_comment". @@ -774,6 +827,74 @@ type PageBuildEvent struct { Installation *Installation `json:"installation,omitempty"` } +// PersonalAccessTokenRequestEvent occurs when there is activity relating to a +// request for a fine-grained personal access token to access resources that +// belong to a resource owner that requires approval for token access. +// The webhook event name is "personal_access_token_request". +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request +type PersonalAccessTokenRequestEvent struct { + // Action is the action that was performed. Possible values are: + // "approved", "cancelled", "created" or "denied" + Action *string `json:"action,omitempty"` + PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + +// PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent. +type PersonalAccessTokenRequest struct { + // Unique identifier of the request for access via fine-grained personal + // access token. Used as the pat_request_id parameter in the list and review + // API calls. + ID *int64 `json:"id,omitempty"` + Owner *User `json:"owner,omitempty"` + + // New requested permissions, categorized by type of permission. + PermissionsAdded *PersonalAccessTokenPermissions `json:"permissions_added,omitempty"` + + // Requested permissions that elevate access for a previously approved + // request for access, categorized by type of permission. + PermissionsUpgraded *PersonalAccessTokenPermissions `json:"permissions_upgraded,omitempty"` + + // Permissions requested, categorized by type of permission. + // This field incorporates permissions_added and permissions_upgraded. + PermissionsResult *PersonalAccessTokenPermissions `json:"permissions_result,omitempty"` + + // Type of repository selection requested. Possible values are: + // "none", "all" or "subset" + RepositorySelection *string `json:"repository_selection,omitempty"` + + // The number of repositories the token is requesting access to. + // This field is only populated when repository_selection is subset. + RepositoryCount *int64 `json:"repository_count,omitempty"` + + // An array of repository objects the token is requesting access to. + // This field is only populated when repository_selection is subset. + Repositories []*Repository `json:"repositories,omitempty"` + + // Date and time when the request for access was created. + CreatedAt *Timestamp `json:"created_at,omitempty"` + + // Whether the associated fine-grained personal access token has expired. + TokenExpired *bool `json:"token_expired,omitempty"` + + // Date and time when the associated fine-grained personal access token expires. + TokenExpiresAt *Timestamp `json:"token_expires_at,omitempty"` + + // Date and time when the associated fine-grained personal access token was last used for authentication. + TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"` +} + +// PersonalAccessTokenPermissions represents the original or newly requested +// scope of permissions for a fine-grained personal access token within a PersonalAccessTokenRequest. +type PersonalAccessTokenPermissions struct { + Org map[string]string `json:"organization,omitempty"` + Repo map[string]string `json:"repository,omitempty"` + Other map[string]string `json:"other,omitempty"` +} + // PingEvent is triggered when a Webhook is added to GitHub. // // GitHub API docs: https://developer.github.com/webhooks/#ping-event @@ -842,6 +963,77 @@ type ProjectColumnEvent struct { Installation *Installation `json:"installation,omitempty"` } +// ProjectV2Event is triggered when there is activity relating to an organization-level project. +// The Webhook event name is "projects_v2". +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 +type ProjectV2Event struct { + Action *string `json:"action,omitempty"` + ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// ProjectsV2 represents a projects v2 project. +type ProjectsV2 struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Owner *User `json:"owner,omitempty"` + Creator *User `json:"creator,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Public *bool `json:"public,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Number *int `json:"number,omitempty"` + ShortDescription *string `json:"short_description,omitempty"` + DeletedBy *User `json:"deleted_by,omitempty"` +} + +// ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. +// The Webhook event name is "projects_v2_item". +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item +type ProjectV2ItemEvent struct { + Action *string `json:"action,omitempty"` + Changes *ProjectV2ItemChange `json:"changes,omitempty"` + ProjectV2Item *ProjectV2Item `json:"projects_v2_item,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// ProjectV2ItemChange represents a project v2 item change. +type ProjectV2ItemChange struct { + ArchivedAt *ArchivedAt `json:"archived_at,omitempty"` +} + +// ArchivedAt represents an archiving date change. +type ArchivedAt struct { + From *Timestamp `json:"from,omitempty"` + To *Timestamp `json:"to,omitempty"` +} + +// ProjectsV2 represents an item belonging to a project. +type ProjectV2Item struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + ProjectNodeID *string `json:"project_node_id,omitempty"` + ContentNodeID *string `json:"content_node_id,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Creator *User `json:"creator,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ArchivedAt *Timestamp `json:"archived_at,omitempty"` +} + // PublicEvent is triggered when a private repository is open sourced. // According to GitHub: "Without a doubt: the best GitHub event." // The Webhook event name is "public". @@ -1225,6 +1417,31 @@ type SecretScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } +// SecurityAndAnalysisEvent is triggered when code security and analysis features +// are enabled or disabled for a repository. +// +// GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis +type SecurityAndAnalysisEvent struct { + Changes *SecurityAndAnalysisChange `json:"changes,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// SecurityAndAnalysisChange represents the changes when security and analysis +// features are enabled or disabled for a repository. +type SecurityAndAnalysisChange struct { + From *SecurityAndAnalysisChangeFrom `json:"from,omitempty"` +} + +// SecurityAndAnalysisChangeFrom represents which change was made when security +// and analysis features are enabled or disabled for a repository. +type SecurityAndAnalysisChangeFrom struct { + SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"` +} + // StarEvent is triggered when a star is added or removed from a repository. // The Webhook event name is "star". // @@ -1393,6 +1610,8 @@ type WorkflowRunEvent struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisory struct { + CVSS *AdvisoryCVSS `json:"cvss,omitempty"` + CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` GHSAID *string `json:"ghsa_id,omitempty"` Summary *string `json:"summary,omitempty"` Description *string `json:"description,omitempty"` @@ -1441,6 +1660,13 @@ type FirstPatchedVersion struct { type SecurityAdvisoryEvent struct { Action *string `json:"action,omitempty"` SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` + + // The following fields are only populated by Webhook events. + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` } // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. diff --git a/vendor/github.com/google/go-github/v53/github/gists.go b/vendor/github.com/google/go-github/v55/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/gists.go rename to vendor/github.com/google/go-github/v55/github/gists.go diff --git a/vendor/github.com/google/go-github/v53/github/gists_comments.go b/vendor/github.com/google/go-github/v55/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/gists_comments.go rename to vendor/github.com/google/go-github/v55/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v53/github/git.go b/vendor/github.com/google/go-github/v55/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/git.go rename to vendor/github.com/google/go-github/v55/github/git.go diff --git a/vendor/github.com/google/go-github/v53/github/git_blobs.go b/vendor/github.com/google/go-github/v55/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/git_blobs.go rename to vendor/github.com/google/go-github/v55/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v53/github/git_commits.go b/vendor/github.com/google/go-github/v55/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/git_commits.go rename to vendor/github.com/google/go-github/v55/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v53/github/git_refs.go b/vendor/github.com/google/go-github/v55/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/git_refs.go rename to vendor/github.com/google/go-github/v55/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v53/github/git_tags.go b/vendor/github.com/google/go-github/v55/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/git_tags.go rename to vendor/github.com/google/go-github/v55/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v53/github/git_trees.go b/vendor/github.com/google/go-github/v55/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/git_trees.go rename to vendor/github.com/google/go-github/v55/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v53/github/github-accessors.go b/vendor/github.com/google/go-github/v55/github/github-accessors.go similarity index 94% rename from vendor/github.com/google/go-github/v53/github/github-accessors.go rename to vendor/github.com/google/go-github/v55/github/github-accessors.go index 8acb72b0..560e0892 100644 --- a/vendor/github.com/google/go-github/v53/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v55/github/github-accessors.go @@ -343,7 +343,7 @@ func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { } // GetScore returns the Score field. -func (a *AdvisoryCVSs) GetScore() *float64 { +func (a *AdvisoryCVSS) GetScore() *float64 { if a == nil { return nil } @@ -351,7 +351,7 @@ func (a *AdvisoryCVSs) GetScore() *float64 { } // GetVectorString returns the VectorString field if it's non-nil, zero value otherwise. -func (a *AdvisoryCVSs) GetVectorString() string { +func (a *AdvisoryCVSS) GetVectorString() string { if a == nil || a.VectorString == nil { return "" } @@ -854,6 +854,22 @@ func (a *AppConfig) GetWebhookSecret() string { return *a.WebhookSecret } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (a *ArchivedAt) GetFrom() Timestamp { + if a == nil || a.From == nil { + return Timestamp{} + } + return *a.From +} + +// GetTo returns the To field if it's non-nil, zero value otherwise. +func (a *ArchivedAt) GetTo() Timestamp { + if a == nil || a.To == nil { + return Timestamp{} + } + return *a.To +} + // GetArchiveDownloadURL returns the ArchiveDownloadURL field if it's non-nil, zero value otherwise. func (a *Artifact) GetArchiveDownloadURL() string { if a == nil || a.ArchiveDownloadURL == nil { @@ -1134,6 +1150,14 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetData returns the Data field. +func (a *AuditEntry) GetData() *AuditEntryData { + if a == nil { + return nil + } + return a.Data +} + // GetDeployKeyFingerprint returns the DeployKeyFingerprint field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDeployKeyFingerprint() string { if a == nil || a.DeployKeyFingerprint == nil { @@ -1590,6 +1614,22 @@ func (a *AuditEntry) GetWorkflowRunID() int64 { return *a.WorkflowRunID } +// GetOldLogin returns the OldLogin field if it's non-nil, zero value otherwise. +func (a *AuditEntryData) GetOldLogin() string { + if a == nil || a.OldLogin == nil { + return "" + } + return *a.OldLogin +} + +// GetOldName returns the OldName field if it's non-nil, zero value otherwise. +func (a *AuditEntryData) GetOldName() string { + if a == nil || a.OldName == nil { + return "" + } + return *a.OldName +} + // GetApp returns the App field. func (a *Authorization) GetApp() *AuthorizationApp { if a == nil { @@ -1846,6 +1886,22 @@ func (a *AutolinkOptions) GetURLTemplate() string { return *a.URLTemplate } +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (a *AutomatedSecurityFixes) GetEnabled() bool { + if a == nil || a.Enabled == nil { + return false + } + return *a.Enabled +} + +// GetPaused returns the Paused field if it's non-nil, zero value otherwise. +func (a *AutomatedSecurityFixes) GetPaused() bool { + if a == nil || a.Paused == nil { + return false + } + return *a.Paused +} + // GetAppID returns the AppID field if it's non-nil, zero value otherwise. func (a *AutoTriggerCheck) GetAppID() int64 { if a == nil || a.AppID == nil { @@ -2238,6 +2294,14 @@ func (b *BypassActor) GetActorType() string { return *b.ActorType } +// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. +func (b *BypassActor) GetBypassMode() string { + if b == nil || b.BypassMode == nil { + return "" + } + return *b.BypassMode +} + // GetApp returns the App field. func (c *CheckRun) GetApp() *App { if c == nil { @@ -2766,6 +2830,78 @@ func (c *CodeownersError) GetSuggestion() string { return *c.Suggestion } +// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetContentType() string { + if c == nil || c.ContentType == nil { + return "" + } + return *c.ContentType +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetLanguage returns the Language field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetLanguage() string { + if c == nil || c.Language == nil { + return "" + } + return *c.Language +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetSize() int64 { + if c == nil || c.Size == nil { + return 0 + } + return *c.Size +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetUploader returns the Uploader field. +func (c *CodeQLDatabase) GetUploader() *User { + if c == nil { + return nil + } + return c.Uploader +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *CodeQLDatabase) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (c *CodeResult) GetHTMLURL() string { if c == nil || c.HTMLURL == nil { @@ -4662,6 +4798,102 @@ func (c *CreateUserProjectOptions) GetBody() string { return *c.Body } +// GetCreated returns the Created field if it's non-nil, zero value otherwise. +func (c *CreationInfo) GetCreated() Timestamp { + if c == nil || c.Created == nil { + return Timestamp{} + } + return *c.Created +} + +// GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { + if c == nil || c.AuthorizedCredentialExpiresAt == nil { + return Timestamp{} + } + return *c.AuthorizedCredentialExpiresAt +} + +// GetAuthorizedCredentialID returns the AuthorizedCredentialID field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialID() int64 { + if c == nil || c.AuthorizedCredentialID == nil { + return 0 + } + return *c.AuthorizedCredentialID +} + +// GetAuthorizedCredentialNote returns the AuthorizedCredentialNote field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialNote() string { + if c == nil || c.AuthorizedCredentialNote == nil { + return "" + } + return *c.AuthorizedCredentialNote +} + +// GetAuthorizedCredentialTitle returns the AuthorizedCredentialTitle field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialTitle() string { + if c == nil || c.AuthorizedCredentialTitle == nil { + return "" + } + return *c.AuthorizedCredentialTitle +} + +// GetCredentialAccessedAt returns the CredentialAccessedAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialAccessedAt() Timestamp { + if c == nil || c.CredentialAccessedAt == nil { + return Timestamp{} + } + return *c.CredentialAccessedAt +} + +// GetCredentialAuthorizedAt returns the CredentialAuthorizedAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialAuthorizedAt() Timestamp { + if c == nil || c.CredentialAuthorizedAt == nil { + return Timestamp{} + } + return *c.CredentialAuthorizedAt +} + +// GetCredentialID returns the CredentialID field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialID() int64 { + if c == nil || c.CredentialID == nil { + return 0 + } + return *c.CredentialID +} + +// GetCredentialType returns the CredentialType field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialType() string { + if c == nil || c.CredentialType == nil { + return "" + } + return *c.CredentialType +} + +// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetFingerprint() string { + if c == nil || c.Fingerprint == nil { + return "" + } + return *c.Fingerprint +} + +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetLogin() string { + if c == nil || c.Login == nil { + return "" + } + return *c.Login +} + +// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetTokenLastEight() string { + if c == nil || c.TokenLastEight == nil { + return "" + } + return *c.TokenLastEight +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetBaseRole() string { if c == nil || c.BaseRole == nil { @@ -4718,6 +4950,22 @@ func (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp { return *d.UpdatedAt } +// GetConfirmDeleteURL returns the ConfirmDeleteURL field if it's non-nil, zero value otherwise. +func (d *DeleteAnalysis) GetConfirmDeleteURL() string { + if d == nil || d.ConfirmDeleteURL == nil { + return "" + } + return *d.ConfirmDeleteURL +} + +// GetNextAnalysisURL returns the NextAnalysisURL field if it's non-nil, zero value otherwise. +func (d *DeleteAnalysis) GetNextAnalysisURL() string { + if d == nil || d.NextAnalysisURL == nil { + return "" + } + return *d.NextAnalysisURL +} + // GetInstallation returns the Installation field. func (d *DeleteEvent) GetInstallation() *Installation { if d == nil { @@ -4766,6 +5014,14 @@ func (d *DeleteEvent) GetSender() *User { return d.Sender } +// GetAutoDismissedAt returns the AutoDismissedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetAutoDismissedAt() Timestamp { + if d == nil || d.AutoDismissedAt == nil { + return Timestamp{} + } + return *d.AutoDismissedAt +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (d *DependabotAlert) GetCreatedAt() Timestamp { if d == nil || d.CreatedAt == nil { @@ -4886,6 +5142,62 @@ func (d *DependabotAlert) GetURL() string { return *d.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DependabotAlertEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetAlert returns the Alert field. +func (d *DependabotAlertEvent) GetAlert() *DependabotAlert { + if d == nil { + return nil + } + return d.Alert +} + +// GetEnterprise returns the Enterprise field. +func (d *DependabotAlertEvent) GetEnterprise() *Enterprise { + if d == nil { + return nil + } + return d.Enterprise +} + +// GetInstallation returns the Installation field. +func (d *DependabotAlertEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrganization returns the Organization field. +func (d *DependabotAlertEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + +// GetRepo returns the Repo field. +func (d *DependabotAlertEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DependabotAlertEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + // GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetCVEID() string { if d == nil || d.CVEID == nil { @@ -4894,12 +5206,12 @@ func (d *DependabotSecurityAdvisory) GetCVEID() string { return *d.CVEID } -// GetCVSs returns the CVSs field. -func (d *DependabotSecurityAdvisory) GetCVSs() *AdvisoryCVSs { +// GetCVSS returns the CVSS field. +func (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS { if d == nil { return nil } - return d.CVSs + return d.CVSS } // GetDescription returns the Description field if it's non-nil, zero value otherwise. @@ -4958,6 +5270,14 @@ func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { return *d.WithdrawnAt } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityUpdates) GetStatus() string { + if d == nil || d.Status == nil { + return "" + } + return *d.Status +} + // GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise. func (d *Dependency) GetManifestPath() string { if d == nil || d.ManifestPath == nil { @@ -5206,6 +5526,22 @@ func (d *DeploymentEvent) GetSender() *User { return d.Sender } +// GetWorkflow returns the Workflow field. +func (d *DeploymentEvent) GetWorkflow() *Workflow { + if d == nil { + return nil + } + return d.Workflow +} + +// GetWorkflowRun returns the WorkflowRun field. +func (d *DeploymentEvent) GetWorkflowRun() *WorkflowRun { + if d == nil { + return nil + } + return d.WorkflowRun +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DeploymentProtectionRuleEvent) GetAction() string { if d == nil || d.Action == nil { @@ -8030,6 +8366,22 @@ func (i *Installation) GetUpdatedAt() Timestamp { return *i.UpdatedAt } +// GetLogin returns the Login field. +func (i *InstallationChanges) GetLogin() *InstallationLoginChange { + if i == nil { + return nil + } + return i.Login +} + +// GetSlug returns the Slug field. +func (i *InstallationChanges) GetSlug() *InstallationSlugChange { + if i == nil { + return nil + } + return i.Slug +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (i *InstallationEvent) GetAction() string { if i == nil || i.Action == nil { @@ -8062,6 +8414,14 @@ func (i *InstallationEvent) GetSender() *User { return i.Sender } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (i *InstallationLoginChange) GetFrom() string { + if i == nil || i.From == nil { + return "" + } + return *i.From +} + // GetActions returns the Actions field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetActions() string { if i == nil || i.Actions == nil { @@ -8390,24 +8750,104 @@ func (i *InstallationRepositoriesEvent) GetSender() *User { return i.Sender } -// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. -func (i *InstallationToken) GetExpiresAt() Timestamp { - if i == nil || i.ExpiresAt == nil { - return Timestamp{} +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (i *InstallationSlugChange) GetFrom() string { + if i == nil || i.From == nil { + return "" } - return *i.ExpiresAt + return *i.From } -// GetPermissions returns the Permissions field. -func (i *InstallationToken) GetPermissions() *InstallationPermissions { +// GetAccount returns the Account field. +func (i *InstallationTargetEvent) GetAccount() *User { if i == nil { return nil } - return i.Permissions + return i.Account } -// GetToken returns the Token field if it's non-nil, zero value otherwise. -func (i *InstallationToken) GetToken() string { +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (i *InstallationTargetEvent) GetAction() string { + if i == nil || i.Action == nil { + return "" + } + return *i.Action +} + +// GetChanges returns the Changes field. +func (i *InstallationTargetEvent) GetChanges() *InstallationChanges { + if i == nil { + return nil + } + return i.Changes +} + +// GetEnterprise returns the Enterprise field. +func (i *InstallationTargetEvent) GetEnterprise() *Enterprise { + if i == nil { + return nil + } + return i.Enterprise +} + +// GetInstallation returns the Installation field. +func (i *InstallationTargetEvent) GetInstallation() *Installation { + if i == nil { + return nil + } + return i.Installation +} + +// GetOrganization returns the Organization field. +func (i *InstallationTargetEvent) GetOrganization() *Organization { + if i == nil { + return nil + } + return i.Organization +} + +// GetRepository returns the Repository field. +func (i *InstallationTargetEvent) GetRepository() *Repository { + if i == nil { + return nil + } + return i.Repository +} + +// GetSender returns the Sender field. +func (i *InstallationTargetEvent) GetSender() *User { + if i == nil { + return nil + } + return i.Sender +} + +// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise. +func (i *InstallationTargetEvent) GetTargetType() string { + if i == nil || i.TargetType == nil { + return "" + } + return *i.TargetType +} + +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (i *InstallationToken) GetExpiresAt() Timestamp { + if i == nil || i.ExpiresAt == nil { + return Timestamp{} + } + return *i.ExpiresAt +} + +// GetPermissions returns the Permissions field. +func (i *InstallationToken) GetPermissions() *InstallationPermissions { + if i == nil { + return nil + } + return i.Permissions +} + +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (i *InstallationToken) GetToken() string { if i == nil || i.Token == nil { return "" } @@ -9406,6 +9846,14 @@ func (j *JITRunnerConfig) GetEncodedJITConfig() string { return *j.EncodedJITConfig } +// GetRunner returns the Runner field. +func (j *JITRunnerConfig) GetRunner() *Runner { + if j == nil { + return nil + } + return j.Runner +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (j *Jobs) GetTotalCount() int { if j == nil || j.TotalCount == nil { @@ -11022,6 +11470,14 @@ func (m *MostRecentInstance) GetAnalysisKey() string { return *m.AnalysisKey } +// GetCategory returns the Category field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetCategory() string { + if m == nil || m.Category == nil { + return "" + } + return *m.Category +} + // GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. func (m *MostRecentInstance) GetCommitSHA() string { if m == nil || m.CommitSHA == nil { @@ -11038,6 +11494,14 @@ func (m *MostRecentInstance) GetEnvironment() string { return *m.Environment } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetHTMLURL() string { + if m == nil || m.HTMLURL == nil { + return "" + } + return *m.HTMLURL +} + // GetLocation returns the Location field. func (m *MostRecentInstance) GetLocation() *Location { if m == nil { @@ -11102,6 +11566,14 @@ func (n *NewPullRequest) GetHead() string { return *n.Head } +// GetHeadRepo returns the HeadRepo field if it's non-nil, zero value otherwise. +func (n *NewPullRequest) GetHeadRepo() string { + if n == nil || n.HeadRepo == nil { + return "" + } + return *n.HeadRepo +} + // GetIssue returns the Issue field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetIssue() int { if n == nil || n.Issue == nil { @@ -13126,6 +13598,158 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetOrg returns the Org map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { + if p == nil || p.Org == nil { + return map[string]string{} + } + return p.Org +} + +// GetOther returns the Other map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOther() map[string]string { + if p == nil || p.Other == nil { + return map[string]string{} + } + return p.Other +} + +// GetRepo returns the Repo map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetRepo() map[string]string { + if p == nil || p.Repo == nil { + return map[string]string{} + } + return p.Repo +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} + } + return *p.CreatedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetOwner returns the Owner field. +func (p *PersonalAccessTokenRequest) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + +// GetPermissionsAdded returns the PermissionsAdded field. +func (p *PersonalAccessTokenRequest) GetPermissionsAdded() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.PermissionsAdded +} + +// GetPermissionsResult returns the PermissionsResult field. +func (p *PersonalAccessTokenRequest) GetPermissionsResult() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.PermissionsResult +} + +// GetPermissionsUpgraded returns the PermissionsUpgraded field. +func (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.PermissionsUpgraded +} + +// GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 { + if p == nil || p.RepositoryCount == nil { + return 0 + } + return *p.RepositoryCount +} + +// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetRepositorySelection() string { + if p == nil || p.RepositorySelection == nil { + return "" + } + return *p.RepositorySelection +} + +// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenExpired() bool { + if p == nil || p.TokenExpired == nil { + return false + } + return *p.TokenExpired +} + +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { + if p == nil || p.TokenExpiresAt == nil { + return Timestamp{} + } + return *p.TokenExpiresAt +} + +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { + if p == nil || p.TokenLastUsedAt == nil { + return Timestamp{} + } + return *p.TokenLastUsedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequestEvent) GetAction() string { + if p == nil || p.Action == nil { + return "" + } + return *p.Action +} + +// GetInstallation returns the Installation field. +func (p *PersonalAccessTokenRequestEvent) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + +// GetOrg returns the Org field. +func (p *PersonalAccessTokenRequestEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetPersonalAccessTokenRequest returns the PersonalAccessTokenRequest field. +func (p *PersonalAccessTokenRequestEvent) GetPersonalAccessTokenRequest() *PersonalAccessTokenRequest { + if p == nil { + return nil + } + return p.PersonalAccessTokenRequest +} + +// GetSender returns the Sender field. +func (p *PersonalAccessTokenRequestEvent) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + // GetHook returns the Hook field. func (p *PingEvent) GetHook() *Hook { if p == nil { @@ -13947,39 +14571,319 @@ func (p *ProjectOptions) GetOrganizationPermission() string { if p == nil || p.OrganizationPermission == nil { return "" } - return *p.OrganizationPermission + return *p.OrganizationPermission +} + +// GetPrivate returns the Private field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetPrivate() bool { + if p == nil || p.Private == nil { + return false + } + return *p.Private +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetState() string { + if p == nil || p.State == nil { + return "" + } + return *p.State +} + +// GetPermission returns the Permission field if it's non-nil, zero value otherwise. +func (p *ProjectPermissionLevel) GetPermission() string { + if p == nil || p.Permission == nil { + return "" + } + return *p.Permission +} + +// GetUser returns the User field. +func (p *ProjectPermissionLevel) GetUser() *User { + if p == nil { + return nil + } + return p.User +} + +// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetClosedAt() Timestamp { + if p == nil || p.ClosedAt == nil { + return Timestamp{} + } + return *p.ClosedAt +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} + } + return *p.CreatedAt +} + +// GetCreator returns the Creator field. +func (p *ProjectsV2) GetCreator() *User { + if p == nil { + return nil + } + return p.Creator +} + +// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetDeletedAt() Timestamp { + if p == nil || p.DeletedAt == nil { + return Timestamp{} + } + return *p.DeletedAt +} + +// GetDeletedBy returns the DeletedBy field. +func (p *ProjectsV2) GetDeletedBy() *User { + if p == nil { + return nil + } + return p.DeletedBy +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetNumber() int { + if p == nil || p.Number == nil { + return 0 + } + return *p.Number +} + +// GetOwner returns the Owner field. +func (p *ProjectsV2) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetShortDescription() string { + if p == nil || p.ShortDescription == nil { + return "" + } + return *p.ShortDescription +} + +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetTitle() string { + if p == nil || p.Title == nil { + return "" + } + return *p.Title +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectsV2) GetUpdatedAt() Timestamp { + if p == nil || p.UpdatedAt == nil { + return Timestamp{} + } + return *p.UpdatedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *ProjectV2Event) GetAction() string { + if p == nil || p.Action == nil { + return "" + } + return *p.Action +} + +// GetInstallation returns the Installation field. +func (p *ProjectV2Event) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + +// GetOrg returns the Org field. +func (p *ProjectV2Event) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetProjectsV2 returns the ProjectsV2 field. +func (p *ProjectV2Event) GetProjectsV2() *ProjectsV2 { + if p == nil { + return nil + } + return p.ProjectsV2 +} + +// GetSender returns the Sender field. +func (p *ProjectV2Event) GetSender() *User { + if p == nil { + return nil + } + return p.Sender +} + +// GetArchivedAt returns the ArchivedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetArchivedAt() Timestamp { + if p == nil || p.ArchivedAt == nil { + return Timestamp{} + } + return *p.ArchivedAt +} + +// GetContentNodeID returns the ContentNodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetContentNodeID() string { + if p == nil || p.ContentNodeID == nil { + return "" + } + return *p.ContentNodeID +} + +// GetContentType returns the ContentType field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetContentType() string { + if p == nil || p.ContentType == nil { + return "" + } + return *p.ContentType +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} + } + return *p.CreatedAt +} + +// GetCreator returns the Creator field. +func (p *ProjectV2Item) GetCreator() *User { + if p == nil { + return nil + } + return p.Creator +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + +// GetProjectNodeID returns the ProjectNodeID field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetProjectNodeID() string { + if p == nil || p.ProjectNodeID == nil { + return "" + } + return *p.ProjectNodeID +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (p *ProjectV2Item) GetUpdatedAt() Timestamp { + if p == nil || p.UpdatedAt == nil { + return Timestamp{} + } + return *p.UpdatedAt +} + +// GetArchivedAt returns the ArchivedAt field. +func (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt { + if p == nil { + return nil + } + return p.ArchivedAt +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *ProjectV2ItemEvent) GetAction() string { + if p == nil || p.Action == nil { + return "" + } + return *p.Action +} + +// GetChanges returns the Changes field. +func (p *ProjectV2ItemEvent) GetChanges() *ProjectV2ItemChange { + if p == nil { + return nil + } + return p.Changes } -// GetPrivate returns the Private field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetPrivate() bool { - if p == nil || p.Private == nil { - return false +// GetInstallation returns the Installation field. +func (p *ProjectV2ItemEvent) GetInstallation() *Installation { + if p == nil { + return nil } - return *p.Private + return p.Installation } -// GetState returns the State field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetState() string { - if p == nil || p.State == nil { - return "" +// GetOrg returns the Org field. +func (p *ProjectV2ItemEvent) GetOrg() *Organization { + if p == nil { + return nil } - return *p.State + return p.Org } -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (p *ProjectPermissionLevel) GetPermission() string { - if p == nil || p.Permission == nil { - return "" +// GetProjectV2Item returns the ProjectV2Item field. +func (p *ProjectV2ItemEvent) GetProjectV2Item() *ProjectV2Item { + if p == nil { + return nil } - return *p.Permission + return p.ProjectV2Item } -// GetUser returns the User field. -func (p *ProjectPermissionLevel) GetUser() *User { +// GetSender returns the Sender field. +func (p *ProjectV2ItemEvent) GetSender() *User { if p == nil { return nil } - return p.User + return p.Sender } // GetAllowDeletions returns the AllowDeletions field. @@ -14982,6 +15886,14 @@ func (p *PullRequestComment) GetStartSide() string { return *p.StartSide } +// GetSubjectType returns the SubjectType field if it's non-nil, zero value otherwise. +func (p *PullRequestComment) GetSubjectType() string { + if p == nil || p.SubjectType == nil { + return "" + } + return *p.SubjectType +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (p *PullRequestComment) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { @@ -16606,6 +17518,62 @@ func (r *RenameOrgResponse) GetURL() string { return *r.URL } +// GetDownloadLocation returns the DownloadLocation field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetDownloadLocation() string { + if r == nil || r.DownloadLocation == nil { + return "" + } + return *r.DownloadLocation +} + +// GetFilesAnalyzed returns the FilesAnalyzed field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetFilesAnalyzed() bool { + if r == nil || r.FilesAnalyzed == nil { + return false + } + return *r.FilesAnalyzed +} + +// GetLicenseConcluded returns the LicenseConcluded field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetLicenseConcluded() string { + if r == nil || r.LicenseConcluded == nil { + return "" + } + return *r.LicenseConcluded +} + +// GetLicenseDeclared returns the LicenseDeclared field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetLicenseDeclared() string { + if r == nil || r.LicenseDeclared == nil { + return "" + } + return *r.LicenseDeclared +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetSPDXID() string { + if r == nil || r.SPDXID == nil { + return "" + } + return *r.SPDXID +} + +// GetVersionInfo returns the VersionInfo field if it's non-nil, zero value otherwise. +func (r *RepoDependencies) GetVersionInfo() string { + if r == nil || r.VersionInfo == nil { + return "" + } + return *r.VersionInfo +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (r *RepoMergeUpstreamRequest) GetBranch() string { if r == nil || r.Branch == nil { @@ -17838,6 +18806,14 @@ func (r *RepositoryContent) GetSize() int { return *r.Size } +// GetSubmoduleGitURL returns the SubmoduleGitURL field if it's non-nil, zero value otherwise. +func (r *RepositoryContent) GetSubmoduleGitURL() string { + if r == nil || r.SubmoduleGitURL == nil { + return "" + } + return *r.SubmoduleGitURL +} + // GetTarget returns the Target field if it's non-nil, zero value otherwise. func (r *RepositoryContent) GetTarget() string { if r == nil || r.Target == nil { @@ -18798,6 +19774,14 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (r *ReviewPersonalAccessTokenRequestOptions) GetReason() string { + if r == nil || r.Reason == nil { + return "" + } + return *r.Reason +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (r *Rule) GetDescription() string { if r == nil || r.Description == nil { @@ -18878,14 +19862,6 @@ func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { return *r.IntegrationID } -// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetBypassMode() string { - if r == nil || r.BypassMode == nil { - return "" - } - return *r.BypassMode -} - // GetConditions returns the Conditions field. func (r *Ruleset) GetConditions() *RulesetConditions { if r == nil { @@ -18894,6 +19870,14 @@ func (r *Ruleset) GetConditions() *RulesetConditions { return r.Conditions } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + // GetLinks returns the Links field. func (r *Ruleset) GetLinks() *RulesetLinks { if r == nil { @@ -18934,8 +19918,16 @@ func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { return r.RefName } +// GetRepositoryID returns the RepositoryID field. +func (r *RulesetConditions) GetRepositoryID() *RulesetRepositoryIDsConditionParameters { + if r == nil { + return nil + } + return r.RepositoryID +} + // GetRepositoryName returns the RepositoryName field. -func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryConditionParameters { +func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryNamesConditionParameters { if r == nil { return nil } @@ -18959,7 +19951,7 @@ func (r *RulesetLinks) GetSelf() *RulesetLink { } // GetProtected returns the Protected field if it's non-nil, zero value otherwise. -func (r *RulesetRepositoryConditionParameters) GetProtected() bool { +func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool { if r == nil || r.Protected == nil { return false } @@ -19222,6 +20214,78 @@ func (s *SarifID) GetURL() string { return *s.URL } +// GetAnalysesURL returns the AnalysesURL field if it's non-nil, zero value otherwise. +func (s *SARIFUpload) GetAnalysesURL() string { + if s == nil || s.AnalysesURL == nil { + return "" + } + return *s.AnalysesURL +} + +// GetProcessingStatus returns the ProcessingStatus field if it's non-nil, zero value otherwise. +func (s *SARIFUpload) GetProcessingStatus() string { + if s == nil || s.ProcessingStatus == nil { + return "" + } + return *s.ProcessingStatus +} + +// GetSBOM returns the SBOM field. +func (s *SBOM) GetSBOM() *SBOMInfo { + if s == nil { + return nil + } + return s.SBOM +} + +// GetCreationInfo returns the CreationInfo field. +func (s *SBOMInfo) GetCreationInfo() *CreationInfo { + if s == nil { + return nil + } + return s.CreationInfo +} + +// GetDataLicense returns the DataLicense field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetDataLicense() string { + if s == nil || s.DataLicense == nil { + return "" + } + return *s.DataLicense +} + +// GetDocumentNamespace returns the DocumentNamespace field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetDocumentNamespace() string { + if s == nil || s.DocumentNamespace == nil { + return "" + } + return *s.DocumentNamespace +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetName() string { + if s == nil || s.Name == nil { + return "" + } + return *s.Name +} + +// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetSPDXID() string { + if s == nil || s.SPDXID == nil { + return "" + } + return *s.SPDXID +} + +// GetSPDXVersion returns the SPDXVersion field if it's non-nil, zero value otherwise. +func (s *SBOMInfo) GetSPDXVersion() string { + if s == nil || s.SPDXVersion == nil { + return "" + } + return *s.SPDXVersion +} + // GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. func (s *ScanningAnalysis) GetAnalysisKey() string { if s == nil || s.AnalysisKey == nil { @@ -19502,6 +20566,14 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetRepository returns the Repository field. +func (s *SecretScanningAlert) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + // GetResolution returns the Resolution field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetResolution() string { if s == nil || s.Resolution == nil { @@ -19542,6 +20614,14 @@ func (s *SecretScanningAlert) GetSecretType() string { return *s.SecretType } +// GetSecretTypeDisplayName returns the SecretTypeDisplayName field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetSecretTypeDisplayName() string { + if s == nil || s.SecretTypeDisplayName == nil { + return "" + } + return *s.SecretTypeDisplayName +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetState() string { if s == nil || s.State == nil { @@ -19734,6 +20814,14 @@ func (s *SecretScanningPushProtection) GetStatus() string { return *s.Status } +// GetCVSS returns the CVSS field. +func (s *SecurityAdvisory) GetCVSS() *AdvisoryCVSS { + if s == nil { + return nil + } + return s.CVSS +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (s *SecurityAdvisory) GetDescription() string { if s == nil || s.Description == nil { @@ -19798,6 +20886,38 @@ func (s *SecurityAdvisoryEvent) GetAction() string { return *s.Action } +// GetEnterprise returns the Enterprise field. +func (s *SecurityAdvisoryEvent) GetEnterprise() *Enterprise { + if s == nil { + return nil + } + return s.Enterprise +} + +// GetInstallation returns the Installation field. +func (s *SecurityAdvisoryEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetOrganization returns the Organization field. +func (s *SecurityAdvisoryEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepository returns the Repository field. +func (s *SecurityAdvisoryEvent) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + // GetSecurityAdvisory returns the SecurityAdvisory field. func (s *SecurityAdvisoryEvent) GetSecurityAdvisory() *SecurityAdvisory { if s == nil { @@ -19806,6 +20926,14 @@ func (s *SecurityAdvisoryEvent) GetSecurityAdvisory() *SecurityAdvisory { return s.SecurityAdvisory } +// GetSender returns the Sender field. +func (s *SecurityAdvisoryEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + // GetAdvancedSecurity returns the AdvancedSecurity field. func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { if s == nil { @@ -19814,6 +20942,14 @@ func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { return s.AdvancedSecurity } +// GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field. +func (s *SecurityAndAnalysis) GetDependabotSecurityUpdates() *DependabotSecurityUpdates { + if s == nil { + return nil + } + return s.DependabotSecurityUpdates +} + // GetSecretScanning returns the SecretScanning field. func (s *SecurityAndAnalysis) GetSecretScanning() *SecretScanning { if s == nil { @@ -19830,6 +20966,70 @@ func (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningP return s.SecretScanningPushProtection } +// GetFrom returns the From field. +func (s *SecurityAndAnalysisChange) GetFrom() *SecurityAndAnalysisChangeFrom { + if s == nil { + return nil + } + return s.From +} + +// GetSecurityAndAnalysis returns the SecurityAndAnalysis field. +func (s *SecurityAndAnalysisChangeFrom) GetSecurityAndAnalysis() *SecurityAndAnalysis { + if s == nil { + return nil + } + return s.SecurityAndAnalysis +} + +// GetChanges returns the Changes field. +func (s *SecurityAndAnalysisEvent) GetChanges() *SecurityAndAnalysisChange { + if s == nil { + return nil + } + return s.Changes +} + +// GetEnterprise returns the Enterprise field. +func (s *SecurityAndAnalysisEvent) GetEnterprise() *Enterprise { + if s == nil { + return nil + } + return s.Enterprise +} + +// GetInstallation returns the Installation field. +func (s *SecurityAndAnalysisEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetOrganization returns the Organization field. +func (s *SecurityAndAnalysisEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepository returns the Repository field. +func (s *SecurityAndAnalysisEvent) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + +// GetSender returns the Sender field. +func (s *SecurityAndAnalysisEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { @@ -23086,6 +24286,14 @@ func (w *WorkflowRun) GetStatus() string { return *w.Status } +// GetTriggeringActor returns the TriggeringActor field. +func (w *WorkflowRun) GetTriggeringActor() *User { + if w == nil { + return nil + } + return w.TriggeringActor +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetUpdatedAt() Timestamp { if w == nil || w.UpdatedAt == nil { diff --git a/vendor/github.com/google/go-github/v53/github/github.go b/vendor/github.com/google/go-github/v55/github/github.go similarity index 91% rename from vendor/github.com/google/go-github/v53/github/github.go rename to vendor/github.com/google/go-github/v55/github/github.go index 34a27282..df011444 100644 --- a/vendor/github.com/google/go-github/v53/github/github.go +++ b/vendor/github.com/google/go-github/v55/github/github.go @@ -24,11 +24,10 @@ import ( "time" "github.com/google/go-querystring/query" - "golang.org/x/oauth2" ) const ( - Version = "v53.2.0" + Version = "v55.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" @@ -126,9 +125,6 @@ const ( // https://developer.github.com/changes/2019-04-24-vulnerability-alerts/ mediaTypeRequiredVulnerabilityAlertsPreview = "application/vnd.github.dorian-preview+json" - // https://developer.github.com/changes/2019-06-04-automated-security-fixes/ - mediaTypeRequiredAutomatedSecurityFixesPreview = "application/vnd.github.london-preview+json" - // https://developer.github.com/changes/2019-05-29-update-branch-api/ mediaTypeUpdatePullRequestBranchPreview = "application/vnd.github.lydian-preview+json" @@ -179,36 +175,38 @@ type Client struct { common service // Reuse a single struct instead of allocating one for each service on the heap. // Services used for talking to different parts of the GitHub API. - Actions *ActionsService - Activity *ActivityService - Admin *AdminService - Apps *AppsService - Authorizations *AuthorizationsService - Billing *BillingService - Checks *ChecksService - CodeScanning *CodeScanningService - Codespaces *CodespacesService - Dependabot *DependabotService - Enterprise *EnterpriseService - Gists *GistsService - Git *GitService - Gitignores *GitignoresService - Interactions *InteractionsService - IssueImport *IssueImportService - Issues *IssuesService - Licenses *LicensesService - Marketplace *MarketplaceService - Migrations *MigrationService - Organizations *OrganizationsService - Projects *ProjectsService - PullRequests *PullRequestsService - Reactions *ReactionsService - Repositories *RepositoriesService - SCIM *SCIMService - Search *SearchService - SecretScanning *SecretScanningService - Teams *TeamsService - Users *UsersService + Actions *ActionsService + Activity *ActivityService + Admin *AdminService + Apps *AppsService + Authorizations *AuthorizationsService + Billing *BillingService + Checks *ChecksService + CodeScanning *CodeScanningService + Codespaces *CodespacesService + Dependabot *DependabotService + DependencyGraph *DependencyGraphService + Enterprise *EnterpriseService + Gists *GistsService + Git *GitService + Gitignores *GitignoresService + Interactions *InteractionsService + IssueImport *IssueImportService + Issues *IssuesService + Licenses *LicensesService + Marketplace *MarketplaceService + Migrations *MigrationService + Organizations *OrganizationsService + Projects *ProjectsService + PullRequests *PullRequestsService + Reactions *ReactionsService + Repositories *RepositoriesService + SCIM *SCIMService + Search *SearchService + SecretScanning *SecretScanningService + SecurityAdvisories *SecurityAdvisoriesService + Teams *TeamsService + Users *UsersService } type service struct { @@ -307,16 +305,92 @@ func addOptions(s string, opts interface{}) (string, error) { // NewClient returns a new GitHub API client. If a nil httpClient is // provided, a new http.Client will be used. To use API methods which require -// authentication, provide an http.Client that will perform the authentication -// for you (such as that provided by the golang.org/x/oauth2 library). +// authentication, either use Client.WithAuthToken or provide NewClient with +// an http.Client that will perform the authentication for you (such as that +// provided by the golang.org/x/oauth2 library). func NewClient(httpClient *http.Client) *Client { - if httpClient == nil { - httpClient = &http.Client{} + c := &Client{client: httpClient} + c.initialize() + return c +} + +// WithAuthToken returns a copy of the client configured to use the provided token for the Authorization header. +func (c *Client) WithAuthToken(token string) *Client { + c2 := c.copy() + defer c2.initialize() + transport := c2.client.Transport + if transport == nil { + transport = http.DefaultTransport + } + c2.client.Transport = roundTripperFunc( + func(req *http.Request) (*http.Response, error) { + req = req.Clone(req.Context()) + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) + return transport.RoundTrip(req) + }, + ) + return c2 +} + +// WithEnterpriseURLs returns a copy of the client configured to use the provided base and +// upload URLs. If the base URL does not have the suffix "/api/v3/", it will be added +// automatically. If the upload URL does not have the suffix "/api/uploads", it will be +// added automatically. +// +// Note that WithEnterpriseURLs is a convenience helper only; +// its behavior is equivalent to setting the BaseURL and UploadURL fields. +// +// Another important thing is that by default, the GitHub Enterprise URL format +// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. +// The upload URL format should be http(s)://[hostname]/api/uploads/. +func (c *Client) WithEnterpriseURLs(baseURL, uploadURL string) (*Client, error) { + c2 := c.copy() + defer c2.initialize() + var err error + c2.BaseURL, err = url.Parse(baseURL) + if err != nil { + return nil, err + } + + if !strings.HasSuffix(c2.BaseURL.Path, "/") { + c2.BaseURL.Path += "/" + } + if !strings.HasSuffix(c2.BaseURL.Path, "/api/v3/") && + !strings.HasPrefix(c2.BaseURL.Host, "api.") && + !strings.Contains(c2.BaseURL.Host, ".api.") { + c2.BaseURL.Path += "api/v3/" + } + + c2.UploadURL, err = url.Parse(uploadURL) + if err != nil { + return nil, err + } + + if !strings.HasSuffix(c2.UploadURL.Path, "/") { + c2.UploadURL.Path += "/" + } + if !strings.HasSuffix(c2.UploadURL.Path, "/api/uploads/") && + !strings.HasPrefix(c2.UploadURL.Host, "api.") && + !strings.Contains(c2.UploadURL.Host, ".api.") { + c2.UploadURL.Path += "api/uploads/" } - baseURL, _ := url.Parse(defaultBaseURL) - uploadURL, _ := url.Parse(uploadBaseURL) + return c2, nil +} - c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: defaultUserAgent, UploadURL: uploadURL} +// initialize sets default values and initializes services. +func (c *Client) initialize() { + if c.client == nil { + c.client = &http.Client{} + } + if c.BaseURL == nil { + c.BaseURL, _ = url.Parse(defaultBaseURL) + } + if c.UploadURL == nil { + c.UploadURL, _ = url.Parse(uploadBaseURL) + } + if c.UserAgent == "" { + c.UserAgent = defaultUserAgent + } c.common.client = c c.Actions = (*ActionsService)(&c.common) c.Activity = (*ActivityService)(&c.common) @@ -328,6 +402,7 @@ func NewClient(httpClient *http.Client) *Client { c.CodeScanning = (*CodeScanningService)(&c.common) c.Codespaces = (*CodespacesService)(&c.common) c.Dependabot = (*DependabotService)(&c.common) + c.DependencyGraph = (*DependencyGraphService)(&c.common) c.Enterprise = (*EnterpriseService)(&c.common) c.Gists = (*GistsService)(&c.common) c.Git = (*GitService)(&c.common) @@ -346,9 +421,30 @@ func NewClient(httpClient *http.Client) *Client { c.SCIM = (*SCIMService)(&c.common) c.Search = (*SearchService)(&c.common) c.SecretScanning = (*SecretScanningService)(&c.common) + c.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) - return c +} + +// copy returns a copy of the current client. It must be initialized before use. +func (c *Client) copy() *Client { + c.clientMu.Lock() + // can't use *c here because that would copy mutexes by value. + clone := Client{ + client: c.client, + UserAgent: c.UserAgent, + BaseURL: c.BaseURL, + UploadURL: c.UploadURL, + secondaryRateLimitReset: c.secondaryRateLimitReset, + } + c.clientMu.Unlock() + if clone.client == nil { + clone.client = &http.Client{} + } + c.rateMu.Lock() + copy(clone.rateLimits[:], c.rateLimits[:]) + c.rateMu.Unlock() + return &clone } // NewClientWithEnvProxy enhances NewClient with the HttpProxy env. @@ -357,56 +453,18 @@ func NewClientWithEnvProxy() *Client { } // NewTokenClient returns a new GitHub API client authenticated with the provided token. -func NewTokenClient(ctx context.Context, token string) *Client { - return NewClient(oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}))) +// Deprecated: Use NewClient(nil).WithAuthToken(token) instead. +func NewTokenClient(_ context.Context, token string) *Client { + // This always returns a nil error. + return NewClient(nil).WithAuthToken(token) } // NewEnterpriseClient returns a new GitHub API client with provided // base URL and upload URL (often is your GitHub Enterprise hostname). -// If the base URL does not have the suffix "/api/v3/", it will be added automatically. -// If the upload URL does not have the suffix "/api/uploads", it will be added automatically. -// If a nil httpClient is provided, a new http.Client will be used. // -// Note that NewEnterpriseClient is a convenience helper only; -// its behavior is equivalent to using NewClient, followed by setting -// the BaseURL and UploadURL fields. -// -// Another important thing is that by default, the GitHub Enterprise URL format -// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. -// The upload URL format should be http(s)://[hostname]/api/uploads/. +// Deprecated: Use NewClient(httpClient).WithOptions(WithEnterpriseURLs(baseURL, uploadURL)) instead. func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) { - baseEndpoint, err := url.Parse(baseURL) - if err != nil { - return nil, err - } - - if !strings.HasSuffix(baseEndpoint.Path, "/") { - baseEndpoint.Path += "/" - } - if !strings.HasSuffix(baseEndpoint.Path, "/api/v3/") && - !strings.HasPrefix(baseEndpoint.Host, "api.") && - !strings.Contains(baseEndpoint.Host, ".api.") { - baseEndpoint.Path += "api/v3/" - } - - uploadEndpoint, err := url.Parse(uploadURL) - if err != nil { - return nil, err - } - - if !strings.HasSuffix(uploadEndpoint.Path, "/") { - uploadEndpoint.Path += "/" - } - if !strings.HasSuffix(uploadEndpoint.Path, "/api/uploads/") && - !strings.HasPrefix(uploadEndpoint.Host, "api.") && - !strings.Contains(uploadEndpoint.Host, ".api.") { - uploadEndpoint.Path += "api/uploads/" - } - - c := NewClient(httpClient) - c.BaseURL = baseEndpoint - c.UploadURL = uploadEndpoint - return c, nil + return NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) } // RequestOption represents an option that can modify an http.Request. @@ -1052,7 +1110,7 @@ func (ae *AcceptedError) Is(target error) bool { if !ok { return false } - return bytes.Compare(ae.Raw, v.Raw) == 0 + return bytes.Equal(ae.Raw, v.Raw) } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the @@ -1538,3 +1596,10 @@ func Int64(v int64) *int64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. func String(v string) *string { return &v } + +// roundTripperFunc creates a RoundTripper (transport) +type roundTripperFunc func(*http.Request) (*http.Response, error) + +func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { + return fn(r) +} diff --git a/vendor/github.com/google/go-github/v53/github/gitignore.go b/vendor/github.com/google/go-github/v55/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/gitignore.go rename to vendor/github.com/google/go-github/v55/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v53/github/interactions.go b/vendor/github.com/google/go-github/v55/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/interactions.go rename to vendor/github.com/google/go-github/v55/github/interactions.go diff --git a/vendor/github.com/google/go-github/v53/github/interactions_orgs.go b/vendor/github.com/google/go-github/v55/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v55/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v53/github/interactions_repos.go b/vendor/github.com/google/go-github/v55/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/interactions_repos.go rename to vendor/github.com/google/go-github/v55/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v53/github/issue_import.go b/vendor/github.com/google/go-github/v55/github/issue_import.go similarity index 97% rename from vendor/github.com/google/go-github/v53/github/issue_import.go rename to vendor/github.com/google/go-github/v55/github/issue_import.go index 4bc8d5f1..04899772 100644 --- a/vendor/github.com/google/go-github/v53/github/issue_import.go +++ b/vendor/github.com/google/go-github/v55/github/issue_import.go @@ -86,14 +86,11 @@ func (s *IssueImportService) Create(ctx context.Context, owner, repo string, iss if err != nil { aerr, ok := err.(*AcceptedError) if ok { - decErr := json.Unmarshal(aerr.Raw, i) - if decErr != nil { - err = decErr + if err := json.Unmarshal(aerr.Raw, i); err != nil { + return i, resp, err } - - return i, resp, nil + return i, resp, err } - return nil, resp, err } diff --git a/vendor/github.com/google/go-github/v53/github/issues.go b/vendor/github.com/google/go-github/v55/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues.go rename to vendor/github.com/google/go-github/v55/github/issues.go diff --git a/vendor/github.com/google/go-github/v53/github/issues_assignees.go b/vendor/github.com/google/go-github/v55/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues_assignees.go rename to vendor/github.com/google/go-github/v55/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v53/github/issues_comments.go b/vendor/github.com/google/go-github/v55/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues_comments.go rename to vendor/github.com/google/go-github/v55/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v53/github/issues_events.go b/vendor/github.com/google/go-github/v55/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues_events.go rename to vendor/github.com/google/go-github/v55/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v53/github/issues_labels.go b/vendor/github.com/google/go-github/v55/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues_labels.go rename to vendor/github.com/google/go-github/v55/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v53/github/issues_milestones.go b/vendor/github.com/google/go-github/v55/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues_milestones.go rename to vendor/github.com/google/go-github/v55/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v53/github/issues_timeline.go b/vendor/github.com/google/go-github/v55/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/issues_timeline.go rename to vendor/github.com/google/go-github/v55/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v53/github/licenses.go b/vendor/github.com/google/go-github/v55/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/licenses.go rename to vendor/github.com/google/go-github/v55/github/licenses.go diff --git a/vendor/github.com/google/go-github/v53/github/messages.go b/vendor/github.com/google/go-github/v55/github/messages.go similarity index 61% rename from vendor/github.com/google/go-github/v53/github/messages.go rename to vendor/github.com/google/go-github/v55/github/messages.go index bb5ae3f3..c16b6015 100644 --- a/vendor/github.com/google/go-github/v53/github/messages.go +++ b/vendor/github.com/google/go-github/v55/github/messages.go @@ -22,6 +22,8 @@ import ( "mime" "net/http" "net/url" + "reflect" + "sort" "strings" ) @@ -43,69 +45,87 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. - eventTypeMapping = map[string]string{ - "branch_protection_rule": "BranchProtectionRuleEvent", - "check_run": "CheckRunEvent", - "check_suite": "CheckSuiteEvent", - "code_scanning_alert": "CodeScanningAlertEvent", - "commit_comment": "CommitCommentEvent", - "content_reference": "ContentReferenceEvent", - "create": "CreateEvent", - "delete": "DeleteEvent", - "deploy_key": "DeployKeyEvent", - "deployment": "DeploymentEvent", - "deployment_status": "DeploymentStatusEvent", - "deployment_protection_rule": "DeploymentProtectionRuleEvent", - "discussion": "DiscussionEvent", - "discussion_comment": "DiscussionCommentEvent", - "fork": "ForkEvent", - "github_app_authorization": "GitHubAppAuthorizationEvent", - "gollum": "GollumEvent", - "installation": "InstallationEvent", - "installation_repositories": "InstallationRepositoriesEvent", - "issue_comment": "IssueCommentEvent", - "issues": "IssuesEvent", - "label": "LabelEvent", - "marketplace_purchase": "MarketplacePurchaseEvent", - "member": "MemberEvent", - "membership": "MembershipEvent", - "merge_group": "MergeGroupEvent", - "meta": "MetaEvent", - "milestone": "MilestoneEvent", - "organization": "OrganizationEvent", - "org_block": "OrgBlockEvent", - "package": "PackageEvent", - "page_build": "PageBuildEvent", - "ping": "PingEvent", - "project": "ProjectEvent", - "project_card": "ProjectCardEvent", - "project_column": "ProjectColumnEvent", - "public": "PublicEvent", - "pull_request": "PullRequestEvent", - "pull_request_review": "PullRequestReviewEvent", - "pull_request_review_comment": "PullRequestReviewCommentEvent", - "pull_request_review_thread": "PullRequestReviewThreadEvent", - "pull_request_target": "PullRequestTargetEvent", - "push": "PushEvent", - "repository": "RepositoryEvent", - "repository_dispatch": "RepositoryDispatchEvent", - "repository_import": "RepositoryImportEvent", - "repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent", - "release": "ReleaseEvent", - "secret_scanning_alert": "SecretScanningAlertEvent", - "security_advisory": "SecurityAdvisoryEvent", - "star": "StarEvent", - "status": "StatusEvent", - "team": "TeamEvent", - "team_add": "TeamAddEvent", - "user": "UserEvent", - "watch": "WatchEvent", - "workflow_dispatch": "WorkflowDispatchEvent", - "workflow_job": "WorkflowJobEvent", - "workflow_run": "WorkflowRunEvent", + eventTypeMapping = map[string]interface{}{ + "branch_protection_rule": &BranchProtectionRuleEvent{}, + "check_run": &CheckRunEvent{}, + "check_suite": &CheckSuiteEvent{}, + "code_scanning_alert": &CodeScanningAlertEvent{}, + "commit_comment": &CommitCommentEvent{}, + "content_reference": &ContentReferenceEvent{}, + "create": &CreateEvent{}, + "delete": &DeleteEvent{}, + "dependabot_alert": &DependabotAlertEvent{}, + "deploy_key": &DeployKeyEvent{}, + "deployment": &DeploymentEvent{}, + "deployment_status": &DeploymentStatusEvent{}, + "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, + "discussion": &DiscussionEvent{}, + "discussion_comment": &DiscussionCommentEvent{}, + "fork": &ForkEvent{}, + "github_app_authorization": &GitHubAppAuthorizationEvent{}, + "gollum": &GollumEvent{}, + "installation": &InstallationEvent{}, + "installation_repositories": &InstallationRepositoriesEvent{}, + "installation_target": &InstallationTargetEvent{}, + "issue_comment": &IssueCommentEvent{}, + "issues": &IssuesEvent{}, + "label": &LabelEvent{}, + "marketplace_purchase": &MarketplacePurchaseEvent{}, + "member": &MemberEvent{}, + "membership": &MembershipEvent{}, + "merge_group": &MergeGroupEvent{}, + "meta": &MetaEvent{}, + "milestone": &MilestoneEvent{}, + "organization": &OrganizationEvent{}, + "org_block": &OrgBlockEvent{}, + "package": &PackageEvent{}, + "page_build": &PageBuildEvent{}, + "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, + "ping": &PingEvent{}, + "project": &ProjectEvent{}, + "project_card": &ProjectCardEvent{}, + "project_column": &ProjectColumnEvent{}, + "projects_v2": &ProjectV2Event{}, + "projects_v2_item": &ProjectV2ItemEvent{}, + "public": &PublicEvent{}, + "pull_request": &PullRequestEvent{}, + "pull_request_review": &PullRequestReviewEvent{}, + "pull_request_review_comment": &PullRequestReviewCommentEvent{}, + "pull_request_review_thread": &PullRequestReviewThreadEvent{}, + "pull_request_target": &PullRequestTargetEvent{}, + "push": &PushEvent{}, + "repository": &RepositoryEvent{}, + "repository_dispatch": &RepositoryDispatchEvent{}, + "repository_import": &RepositoryImportEvent{}, + "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, + "release": &ReleaseEvent{}, + "secret_scanning_alert": &SecretScanningAlertEvent{}, + "security_advisory": &SecurityAdvisoryEvent{}, + "security_and_analysis": &SecurityAndAnalysisEvent{}, + "star": &StarEvent{}, + "status": &StatusEvent{}, + "team": &TeamEvent{}, + "team_add": &TeamAddEvent{}, + "user": &UserEvent{}, + "watch": &WatchEvent{}, + "workflow_dispatch": &WorkflowDispatchEvent{}, + "workflow_job": &WorkflowJobEvent{}, + "workflow_run": &WorkflowRunEvent{}, } + // forward mapping of event types to the string names of the structs + messageToTypeName = make(map[string]string, len(eventTypeMapping)) + // Inverse map of the above + typeToMessageMapping = make(map[string]string, len(eventTypeMapping)) ) +func init() { + for k, v := range eventTypeMapping { + typename := reflect.TypeOf(v).Elem().Name() + messageToTypeName[k] = typename + typeToMessageMapping[typename] = k + } +} + // genMAC generates the HMAC signature for a message provided the secret key // and hashFunc. func genMAC(message, key []byte, hashFunc func() hash.Hash) []byte { @@ -294,7 +314,7 @@ func DeliveryID(r *http.Request) string { // } // } func ParseWebHook(messageType string, payload []byte) (interface{}, error) { - eventType, ok := eventTypeMapping[messageType] + eventType, ok := messageToTypeName[messageType] if !ok { return nil, fmt.Errorf("unknown X-Github-Event in message: %v", messageType) } @@ -305,3 +325,28 @@ func ParseWebHook(messageType string, payload []byte) (interface{}, error) { } return event.ParsePayload() } + +// WebhookTypes returns a sorted list of all the known GitHub event type strings +// supported by go-github. +func MessageTypes() []string { + types := make([]string, 0, len(eventTypeMapping)) + for t := range eventTypeMapping { + types = append(types, t) + } + sort.Strings(types) + return types +} + +// EventForType returns an empty struct matching the specified GitHub event type. +// If messageType does not match any known event types, it returns nil. +func EventForType(messageType string) interface{} { + prototype := eventTypeMapping[messageType] + if prototype == nil { + return nil + } + // return a _copy_ of the pointed-to-object. Unfortunately, for this we + // need to use reflection. If we store the actual objects in the map, + // we still need to use reflection to convert from `any` to the actual + // type, so this was deemed the lesser of two evils. (#2865) + return reflect.New(reflect.TypeOf(prototype).Elem()).Interface() +} diff --git a/vendor/github.com/google/go-github/v53/github/migrations.go b/vendor/github.com/google/go-github/v55/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/migrations.go rename to vendor/github.com/google/go-github/v55/github/migrations.go diff --git a/vendor/github.com/google/go-github/v53/github/migrations_source_import.go b/vendor/github.com/google/go-github/v55/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v55/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v53/github/migrations_user.go b/vendor/github.com/google/go-github/v55/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/migrations_user.go rename to vendor/github.com/google/go-github/v55/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v53/github/misc.go b/vendor/github.com/google/go-github/v55/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/misc.go rename to vendor/github.com/google/go-github/v55/github/misc.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs.go b/vendor/github.com/google/go-github/v55/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs.go rename to vendor/github.com/google/go-github/v55/github/orgs.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v55/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v55/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v55/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v55/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v55/github/orgs_audit_log.go similarity index 96% rename from vendor/github.com/google/go-github/v53/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v55/github/orgs_audit_log.go index e2e4692e..4c34445f 100644 --- a/vendor/github.com/google/go-github/v53/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v55/github/orgs_audit_log.go @@ -121,6 +121,14 @@ type AuditEntry struct { Visibility *string `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`. WorkflowID *int64 `json:"workflow_id,omitempty"` WorkflowRunID *int64 `json:"workflow_run_id,omitempty"` + + Data *AuditEntryData `json:"data,omitempty"` +} + +// AuditEntryData represents additional information stuffed into a `data` field. +type AuditEntryData struct { + OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change + OldLogin *string `json:"old_login,omitempty"` // The previous name of the organization, for a name change } // GetAuditLog gets the audit-log entries for an organization. diff --git a/vendor/github.com/google/go-github/v55/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v55/github/orgs_credential_authorizations.go new file mode 100644 index 00000000..6d56fe8f --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/orgs_credential_authorizations.go @@ -0,0 +1,95 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" + "net/http" +) + +// CredentialAuthorization represents a credential authorized through SAML SSO. +type CredentialAuthorization struct { + // User login that owns the underlying credential. + Login *string `json:"login,omitempty"` + + // Unique identifier for the credential. + CredentialID *int64 `json:"credential_id,omitempty"` + + // Human-readable description of the credential type. + CredentialType *string `json:"credential_type,omitempty"` + + // Last eight characters of the credential. + // Only included in responses with credential_type of personal access token. + TokenLastEight *string `json:"token_last_eight,omitempty"` + + // Date when the credential was authorized for use. + CredentialAuthorizedAt *Timestamp `json:"credential_authorized_at,omitempty"` + + // Date when the credential was last accessed. + // May be null if it was never accessed. + CredentialAccessedAt *Timestamp `json:"credential_accessed_at,omitempty"` + + // List of oauth scopes the token has been granted. + Scopes []string `json:"scopes,omitempty"` + + // Unique string to distinguish the credential. + // Only included in responses with credential_type of SSH Key. + Fingerprint *string `json:"fingerprint,omitempty"` + + AuthorizedCredentialID *int64 `json:"authorized_credential_id,omitempty"` + + // The title given to the ssh key. + // This will only be present when the credential is an ssh key. + AuthorizedCredentialTitle *string `json:"authorized_credential_title,omitempty"` + + // The note given to the token. + // This will only be present when the credential is a token. + AuthorizedCredentialNote *string `json:"authorized_credential_note,omitempty"` + + // The expiry for the token. + // This will only be present when the credential is a token. + AuthorizedCredentialExpiresAt *Timestamp `json:"authorized_credential_expires_at,omitempty"` +} + +// ListCredentialAuthorizations lists credentials authorized through SAML SSO +// for a given organization. Only available with GitHub Enterprise Cloud. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#list-saml-sso-authorizations-for-an-organization +func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { + u := fmt.Sprintf("orgs/%v/credential-authorizations", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(http.MethodGet, u, nil) + if err != nil { + return nil, nil, err + } + + var creds []*CredentialAuthorization + resp, err := s.client.Do(ctx, req, &creds) + if err != nil { + return nil, resp, err + } + + return creds, resp, nil +} + +// RemoveCredentialAuthorization revokes the SAML SSO authorization for a given +// credential within an organization. Only available with GitHub Enterprise Cloud. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#remove-a-saml-sso-authorization-for-an-organization +func (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/credential-authorizations/%v", org, credentialID) + req, err := s.client.NewRequest(http.MethodDelete, u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v53/github/orgs_custom_roles.go b/vendor/github.com/google/go-github/v55/github/orgs_custom_roles.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_custom_roles.go rename to vendor/github.com/google/go-github/v55/github/orgs_custom_roles.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_hooks.go b/vendor/github.com/google/go-github/v55/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v55/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v55/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v55/github/orgs_hooks_configuration.go new file mode 100644 index 00000000..953a2329 --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/orgs_hooks_configuration.go @@ -0,0 +1,49 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// GetHookConfiguration returns the configuration for the specified organization webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#get-a-webhook-configuration-for-an-organization +func (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + config := new(HookConfig) + resp, err := s.client.Do(ctx, req, config) + if err != nil { + return nil, resp, err + } + + return config, resp, nil +} + +// EditHookConfiguration updates the configuration for the specified organization webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/webhooks?apiVersion=2022-11-28#update-a-webhook-configuration-for-an-organization +func (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/hooks/%v/config", org, id) + req, err := s.client.NewRequest("PATCH", u, config) + if err != nil { + return nil, nil, err + } + + c := new(HookConfig) + resp, err := s.client.Do(ctx, req, c) + if err != nil { + return nil, resp, err + } + + return c, resp, nil +} diff --git a/vendor/github.com/google/go-github/v53/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v55/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v55/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_members.go b/vendor/github.com/google/go-github/v55/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_members.go rename to vendor/github.com/google/go-github/v55/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v55/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v55/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_packages.go b/vendor/github.com/google/go-github/v55/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_packages.go rename to vendor/github.com/google/go-github/v55/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v55/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v55/github/orgs_personal_access_tokens.go new file mode 100644 index 00000000..c30ff284 --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/orgs_personal_access_tokens.go @@ -0,0 +1,34 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" + "net/http" +) + +// ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method. +type ReviewPersonalAccessTokenRequestOptions struct { + Action string `json:"action"` + Reason *string `json:"reason,omitempty"` +} + +// ReviewPersonalAccessTokenRequest approves or denies a pending request to access organization resources via a fine-grained personal access token. +// Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. +// `action` can be one of `approve` or `deny`. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { + u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) + + req, err := s.client.NewRequest(http.MethodPost, u, &opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v53/github/orgs_projects.go b/vendor/github.com/google/go-github/v55/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_projects.go rename to vendor/github.com/google/go-github/v55/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_rules.go b/vendor/github.com/google/go-github/v55/github/orgs_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_rules.go rename to vendor/github.com/google/go-github/v55/github/orgs_rules.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v55/github/orgs_security_managers.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v55/github/orgs_security_managers.go diff --git a/vendor/github.com/google/go-github/v53/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v55/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v55/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v53/github/packages.go b/vendor/github.com/google/go-github/v55/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/packages.go rename to vendor/github.com/google/go-github/v55/github/packages.go diff --git a/vendor/github.com/google/go-github/v53/github/projects.go b/vendor/github.com/google/go-github/v55/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/projects.go rename to vendor/github.com/google/go-github/v55/github/projects.go diff --git a/vendor/github.com/google/go-github/v53/github/pulls.go b/vendor/github.com/google/go-github/v55/github/pulls.go similarity index 99% rename from vendor/github.com/google/go-github/v53/github/pulls.go rename to vendor/github.com/google/go-github/v55/github/pulls.go index 6e49eba2..29549e24 100644 --- a/vendor/github.com/google/go-github/v53/github/pulls.go +++ b/vendor/github.com/google/go-github/v55/github/pulls.go @@ -170,7 +170,7 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // By default, the PullRequestListOptions State filters for "open". // // GitHub API docs: https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit -func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { +func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) if err != nil { @@ -244,6 +244,7 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str type NewPullRequest struct { Title *string `json:"title,omitempty"` Head *string `json:"head,omitempty"` + HeadRepo *string `json:"head_repo,omitempty"` Base *string `json:"base,omitempty"` Body *string `json:"body,omitempty"` Issue *int `json:"issue,omitempty"` diff --git a/vendor/github.com/google/go-github/v53/github/pulls_comments.go b/vendor/github.com/google/go-github/v55/github/pulls_comments.go similarity index 97% rename from vendor/github.com/google/go-github/v53/github/pulls_comments.go rename to vendor/github.com/google/go-github/v55/github/pulls_comments.go index 1f6b726d..ea1cf45d 100644 --- a/vendor/github.com/google/go-github/v53/github/pulls_comments.go +++ b/vendor/github.com/google/go-github/v55/github/pulls_comments.go @@ -41,6 +41,8 @@ type PullRequestComment struct { URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` + // Can be one of: LINE, FILE from https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request + SubjectType *string `json:"subject_type,omitempty"` } func (p PullRequestComment) String() string { diff --git a/vendor/github.com/google/go-github/v53/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v55/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v55/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v53/github/pulls_reviews.go b/vendor/github.com/google/go-github/v55/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v55/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v53/github/pulls_threads.go b/vendor/github.com/google/go-github/v55/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/pulls_threads.go rename to vendor/github.com/google/go-github/v55/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v53/github/reactions.go b/vendor/github.com/google/go-github/v55/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/reactions.go rename to vendor/github.com/google/go-github/v55/github/reactions.go diff --git a/vendor/github.com/google/go-github/v53/github/repos.go b/vendor/github.com/google/go-github/v55/github/repos.go similarity index 97% rename from vendor/github.com/google/go-github/v53/github/repos.go rename to vendor/github.com/google/go-github/v55/github/repos.go index 5ffad6dd..83fc3f8e 100644 --- a/vendor/github.com/google/go-github/v53/github/repos.go +++ b/vendor/github.com/google/go-github/v55/github/repos.go @@ -210,6 +210,7 @@ type SecurityAndAnalysis struct { AdvancedSecurity *AdvancedSecurity `json:"advanced_security,omitempty"` SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` SecretScanningPushProtection *SecretScanningPushProtection `json:"secret_scanning_push_protection,omitempty"` + DependabotSecurityUpdates *DependabotSecurityUpdates `json:"dependabot_security_updates,omitempty"` } func (s SecurityAndAnalysis) String() string { @@ -245,6 +246,21 @@ type SecretScanningPushProtection struct { Status *string `json:"status,omitempty"` } +func (s SecretScanningPushProtection) String() string { + return Stringify(s) +} + +// DependabotSecurityUpdates specifies the state of Dependabot security updates on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates +type DependabotSecurityUpdates struct { + Status *string `json:"status,omitempty"` +} + +func (d DependabotSecurityUpdates) String() string { + return Stringify(d) +} + // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // @@ -687,6 +703,25 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow return s.client.Do(ctx, req, nil) } +// GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-automated-security-fixes-are-enabled-for-a-repository +func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/automated-security-fixes", owner, repository) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + p := new(AutomatedSecurityFixes) + resp, err := s.client.Do(ctx, req, p) + if err != nil { + return nil, resp, err + } + return p, resp, nil +} + // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // // GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-automated-security-fixes @@ -698,9 +733,6 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, return nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeRequiredAutomatedSecurityFixesPreview) - return s.client.Do(ctx, req, nil) } @@ -715,9 +747,6 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, return nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeRequiredAutomatedSecurityFixesPreview) - return s.client.Do(ctx, req, nil) } @@ -1212,6 +1241,12 @@ type SignaturesProtectedBranch struct { Enabled *bool `json:"enabled,omitempty"` } +// AutomatedSecurityFixes represents their status. +type AutomatedSecurityFixes struct { + Enabled *bool `json:"enabled"` + Paused *bool `json:"paused"` +} + // ListBranches lists branches for the specified repository. // // GitHub API docs: https://docs.github.com/en/rest/branches/branches#list-branches @@ -2034,3 +2069,43 @@ func isBranchNotProtected(err error) bool { errorResponse, ok := err.(*ErrorResponse) return ok && errorResponse.Message == githubBranchNotProtected } + +// EnablePrivateReporting enables private reporting of vulnerabilities for a +// repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +func (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) + + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DisablePrivateReporting disables private reporting of vulnerabilities for a +// repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/vendor/github.com/google/go-github/v53/github/repos_actions_access.go b/vendor/github.com/google/go-github/v55/github/repos_actions_access.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v55/github/repos_actions_access.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v55/github/repos_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v55/github/repos_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v55/github/repos_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v55/github/repos_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_autolinks.go b/vendor/github.com/google/go-github/v55/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v55/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_codeowners.go b/vendor/github.com/google/go-github/v55/github/repos_codeowners.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v55/github/repos_codeowners.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_collaborators.go b/vendor/github.com/google/go-github/v55/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v55/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_comments.go b/vendor/github.com/google/go-github/v55/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_comments.go rename to vendor/github.com/google/go-github/v55/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_commits.go b/vendor/github.com/google/go-github/v55/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_commits.go rename to vendor/github.com/google/go-github/v55/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_community_health.go b/vendor/github.com/google/go-github/v55/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_community_health.go rename to vendor/github.com/google/go-github/v55/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_contents.go b/vendor/github.com/google/go-github/v55/github/repos_contents.go similarity index 95% rename from vendor/github.com/google/go-github/v53/github/repos_contents.go rename to vendor/github.com/google/go-github/v55/github/repos_contents.go index 874a3277..de7a0d5b 100644 --- a/vendor/github.com/google/go-github/v53/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v55/github/repos_contents.go @@ -21,6 +21,8 @@ import ( "strings" ) +var ErrPathForbidden = errors.New("path must not contain '..' due to auth vulnerability issue") + // RepositoryContent represents a file or directory in a github repository. type RepositoryContent struct { Type *string `json:"type,omitempty"` @@ -34,12 +36,13 @@ type RepositoryContent struct { // Content contains the actual file content, which may be encoded. // Callers should call GetContent which will decode the content if // necessary. - Content *string `json:"content,omitempty"` - SHA *string `json:"sha,omitempty"` - URL *string `json:"url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - DownloadURL *string `json:"download_url,omitempty"` + Content *string `json:"content,omitempty"` + SHA *string `json:"sha,omitempty"` + URL *string `json:"url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + DownloadURL *string `json:"download_url,omitempty"` + SubmoduleGitURL *string `json:"submodule_git_url,omitempty"` } // RepositoryContentResponse holds the parsed response from CreateFile, UpdateFile, and DeleteFile. @@ -198,7 +201,7 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne // GitHub API docs: https://docs.github.com/en/rest/repos/contents#get-repository-content func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) { if strings.Contains(path, "..") { - return nil, nil, nil, errors.New("path must not contain '..' due to auth vulnerability issue") + return nil, nil, nil, ErrPathForbidden } escapedPath := (&url.URL{Path: strings.TrimSuffix(path, "/")}).String() diff --git a/vendor/github.com/google/go-github/v53/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v55/github/repos_deployment_branch_policies.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v55/github/repos_deployment_branch_policies.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_deployments.go b/vendor/github.com/google/go-github/v55/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_deployments.go rename to vendor/github.com/google/go-github/v55/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_environments.go b/vendor/github.com/google/go-github/v55/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_environments.go rename to vendor/github.com/google/go-github/v55/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_forks.go b/vendor/github.com/google/go-github/v55/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_forks.go rename to vendor/github.com/google/go-github/v55/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_hooks.go b/vendor/github.com/google/go-github/v55/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_hooks.go rename to vendor/github.com/google/go-github/v55/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v55/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v55/github/repos_hooks_configuration.go new file mode 100644 index 00000000..5aadfb64 --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/repos_hooks_configuration.go @@ -0,0 +1,49 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// GetHookConfiguration returns the configuration for the specified repository webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#get-a-webhook-configuration-for-a-repository +func (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + config := new(HookConfig) + resp, err := s.client.Do(ctx, req, config) + if err != nil { + return nil, resp, err + } + + return config, resp, nil +} + +// EditHookConfiguration updates the configuration for the specified repository webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/webhooks/repo-config?apiVersion=2022-11-28#update-a-webhook-configuration-for-a-repository +func (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/hooks/%v/config", owner, repo, id) + req, err := s.client.NewRequest("PATCH", u, config) + if err != nil { + return nil, nil, err + } + + c := new(HookConfig) + resp, err := s.client.Do(ctx, req, c) + if err != nil { + return nil, resp, err + } + + return c, resp, nil +} diff --git a/vendor/github.com/google/go-github/v53/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v55/github/repos_hooks_deliveries.go similarity index 97% rename from vendor/github.com/google/go-github/v53/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v55/github/repos_hooks_deliveries.go index cbd2d381..5f2f8807 100644 --- a/vendor/github.com/google/go-github/v53/github/repos_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v55/github/repos_hooks_deliveries.go @@ -126,9 +126,9 @@ func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, // ParseRequestPayload parses the request payload. For recognized event types, // a value of the corresponding struct type will be returned. func (d *HookDelivery) ParseRequestPayload() (interface{}, error) { - eType, ok := eventTypeMapping[*d.Event] + eType, ok := messageToTypeName[d.GetEvent()] if !ok { - return nil, fmt.Errorf("unsupported event type %q", *d.Event) + return nil, fmt.Errorf("unsupported event type %q", d.GetEvent()) } e := &Event{Type: &eType, RawPayload: d.Request.RawPayload} diff --git a/vendor/github.com/google/go-github/v53/github/repos_invitations.go b/vendor/github.com/google/go-github/v55/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_invitations.go rename to vendor/github.com/google/go-github/v55/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_keys.go b/vendor/github.com/google/go-github/v55/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_keys.go rename to vendor/github.com/google/go-github/v55/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_lfs.go b/vendor/github.com/google/go-github/v55/github/repos_lfs.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_lfs.go rename to vendor/github.com/google/go-github/v55/github/repos_lfs.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_merging.go b/vendor/github.com/google/go-github/v55/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_merging.go rename to vendor/github.com/google/go-github/v55/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_pages.go b/vendor/github.com/google/go-github/v55/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_pages.go rename to vendor/github.com/google/go-github/v55/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v55/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v55/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_projects.go b/vendor/github.com/google/go-github/v55/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_projects.go rename to vendor/github.com/google/go-github/v55/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_releases.go b/vendor/github.com/google/go-github/v55/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_releases.go rename to vendor/github.com/google/go-github/v55/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_rules.go b/vendor/github.com/google/go-github/v55/github/repos_rules.go similarity index 91% rename from vendor/github.com/google/go-github/v53/github/repos_rules.go rename to vendor/github.com/google/go-github/v55/github/repos_rules.go index 9299d3e7..7f964fe6 100644 --- a/vendor/github.com/google/go-github/v53/github/repos_rules.go +++ b/vendor/github.com/google/go-github/v55/github/repos_rules.go @@ -14,8 +14,10 @@ import ( // BypassActor represents the bypass actors from a ruleset. type BypassActor struct { ActorID *int64 `json:"actor_id,omitempty"` - // Possible values for ActorType are: Team, Integration + // Possible values for ActorType are: RepositoryRole, Team, Integration, OrganizationAdmin ActorType *string `json:"actor_type,omitempty"` + // Possible values for BypassMode are: always, pull_request + BypassMode *string `json:"bypass_mode,omitempty"` } // RulesetLink represents a single link object from GitHub ruleset request _links. @@ -34,17 +36,24 @@ type RulesetRefConditionParameters struct { Exclude []string `json:"exclude"` } -// RulesetRepositoryConditionParameters represents the conditions object for repository_names. -type RulesetRepositoryConditionParameters struct { - Include []string `json:"include,omitempty"` - Exclude []string `json:"exclude,omitempty"` +// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. +type RulesetRepositoryNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` Protected *bool `json:"protected,omitempty"` } +// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids. +type RulesetRepositoryIDsConditionParameters struct { + RepositoryIDs []int64 `json:"repository_ids,omitempty"` +} + // RulesetCondition represents the conditions object in a ruleset. +// Set either RepositoryName or RepositoryID, not both. type RulesetConditions struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` - RepositoryName *RulesetRepositoryConditionParameters `json:"repository_name,omitempty"` + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` + RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` } // RulePatternParameters represents the rule pattern parameters. @@ -109,6 +118,10 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { case "creation", "deletion", "required_linear_history", "required_signatures", "non_fast_forward": r.Parameters = nil case "update": + if RepositoryRule.Parameters == nil { + r.Parameters = nil + return nil + } params := UpdateAllowsFetchAndMergeRuleParameters{} if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { return err @@ -118,6 +131,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { rawParams := json.RawMessage(bytes) r.Parameters = &rawParams + case "required_deployments": params := RequiredDeploymentEnvironmentsRuleParameters{} if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { @@ -176,13 +190,18 @@ func NewCreationRule() (rule *RepositoryRule) { // NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) + if params != nil { + bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) + rawParams := json.RawMessage(bytes) + return &RepositoryRule{ + Type: "update", + Parameters: &rawParams, + } + } return &RepositoryRule{ - Type: "update", - Parameters: &rawParams, + Type: "update", } } @@ -312,7 +331,7 @@ func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) // Ruleset represents a GitHub ruleset object. type Ruleset struct { - ID int64 `json:"id"` + ID *int64 `json:"id,omitempty"` Name string `json:"name"` // Possible values for Target are branch, tag Target *string `json:"target,omitempty"` @@ -320,9 +339,7 @@ type Ruleset struct { SourceType *string `json:"source_type,omitempty"` Source string `json:"source"` // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - // Possible values for BypassMode are: none, repository, organization - BypassMode *string `json:"bypass_mode,omitempty"` + Enforcement string `json:"enforcement"` BypassActors []*BypassActor `json:"bypass_actors,omitempty"` NodeID *string `json:"node_id,omitempty"` Links *RulesetLinks `json:"_links,omitempty"` diff --git a/vendor/github.com/google/go-github/v53/github/repos_stats.go b/vendor/github.com/google/go-github/v55/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_stats.go rename to vendor/github.com/google/go-github/v55/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_statuses.go b/vendor/github.com/google/go-github/v55/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_statuses.go rename to vendor/github.com/google/go-github/v55/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_tags.go b/vendor/github.com/google/go-github/v55/github/repos_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_tags.go rename to vendor/github.com/google/go-github/v55/github/repos_tags.go diff --git a/vendor/github.com/google/go-github/v53/github/repos_traffic.go b/vendor/github.com/google/go-github/v55/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/repos_traffic.go rename to vendor/github.com/google/go-github/v55/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v53/github/scim.go b/vendor/github.com/google/go-github/v55/github/scim.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/scim.go rename to vendor/github.com/google/go-github/v55/github/scim.go diff --git a/vendor/github.com/google/go-github/v53/github/search.go b/vendor/github.com/google/go-github/v55/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/search.go rename to vendor/github.com/google/go-github/v55/github/search.go diff --git a/vendor/github.com/google/go-github/v53/github/secret_scanning.go b/vendor/github.com/google/go-github/v55/github/secret_scanning.go similarity index 91% rename from vendor/github.com/google/go-github/v53/github/secret_scanning.go rename to vendor/github.com/google/go-github/v55/github/secret_scanning.go index d512560d..b8295cbf 100644 --- a/vendor/github.com/google/go-github/v53/github/secret_scanning.go +++ b/vendor/github.com/google/go-github/v55/github/secret_scanning.go @@ -16,17 +16,19 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - Secret *string `json:"secret,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. diff --git a/vendor/github.com/google/go-github/v55/github/security_advisories.go b/vendor/github.com/google/go-github/v55/github/security_advisories.go new file mode 100644 index 00000000..a75fce54 --- /dev/null +++ b/vendor/github.com/google/go-github/v55/github/security_advisories.go @@ -0,0 +1,37 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +type SecurityAdvisoriesService service + +// RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory. +// The ghsaID is the GitHub Security Advisory identifier of the advisory. +// +// GitHub API docs: https://docs.github.com/en/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +func (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/security-advisories/%v/cve", owner, repo, ghsaID) + + req, err := s.client.NewRequest("POST", url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + if _, ok := err.(*AcceptedError); ok { + return resp, nil + } + + return resp, err + } + + return resp, nil +} diff --git a/vendor/github.com/google/go-github/v53/github/strings.go b/vendor/github.com/google/go-github/v55/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/strings.go rename to vendor/github.com/google/go-github/v55/github/strings.go diff --git a/vendor/github.com/google/go-github/v53/github/teams.go b/vendor/github.com/google/go-github/v55/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/teams.go rename to vendor/github.com/google/go-github/v55/github/teams.go diff --git a/vendor/github.com/google/go-github/v53/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v55/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v55/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v53/github/teams_discussions.go b/vendor/github.com/google/go-github/v55/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/teams_discussions.go rename to vendor/github.com/google/go-github/v55/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v53/github/teams_members.go b/vendor/github.com/google/go-github/v55/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/teams_members.go rename to vendor/github.com/google/go-github/v55/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v53/github/timestamp.go b/vendor/github.com/google/go-github/v55/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/timestamp.go rename to vendor/github.com/google/go-github/v55/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v53/github/users.go b/vendor/github.com/google/go-github/v55/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users.go rename to vendor/github.com/google/go-github/v55/github/users.go diff --git a/vendor/github.com/google/go-github/v53/github/users_administration.go b/vendor/github.com/google/go-github/v55/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_administration.go rename to vendor/github.com/google/go-github/v55/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v53/github/users_blocking.go b/vendor/github.com/google/go-github/v55/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_blocking.go rename to vendor/github.com/google/go-github/v55/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v53/github/users_emails.go b/vendor/github.com/google/go-github/v55/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_emails.go rename to vendor/github.com/google/go-github/v55/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v53/github/users_followers.go b/vendor/github.com/google/go-github/v55/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_followers.go rename to vendor/github.com/google/go-github/v55/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v53/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v55/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v55/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v53/github/users_keys.go b/vendor/github.com/google/go-github/v55/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_keys.go rename to vendor/github.com/google/go-github/v55/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v53/github/users_packages.go b/vendor/github.com/google/go-github/v55/github/users_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_packages.go rename to vendor/github.com/google/go-github/v55/github/users_packages.go diff --git a/vendor/github.com/google/go-github/v53/github/users_projects.go b/vendor/github.com/google/go-github/v55/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_projects.go rename to vendor/github.com/google/go-github/v55/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v53/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v55/github/users_ssh_signing_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v55/github/users_ssh_signing_keys.go diff --git a/vendor/github.com/google/go-github/v53/github/with_appengine.go b/vendor/github.com/google/go-github/v55/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/with_appengine.go rename to vendor/github.com/google/go-github/v55/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v53/github/without_appengine.go b/vendor/github.com/google/go-github/v55/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v53/github/without_appengine.go rename to vendor/github.com/google/go-github/v55/github/without_appengine.go diff --git a/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go b/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go index fe91b098..2668b34a 100644 --- a/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go +++ b/vendor/github.com/palantir/go-githubapp/appconfig/appconfig.go @@ -25,7 +25,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/pkg/errors" "github.com/rs/zerolog" ) diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go b/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go index 68d67ee6..e93c3c3c 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/caching_client_creator.go @@ -17,7 +17,7 @@ package githubapp import ( "fmt" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" lru "github.com/hashicorp/golang-lru" "github.com/pkg/errors" "github.com/shurcooL/githubv4" diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go b/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go index d984a693..a798dec4 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go @@ -24,7 +24,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/gregjones/httpcache" "github.com/pkg/errors" "github.com/shurcooL/githubv4" diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/context.go b/vendor/github.com/palantir/go-githubapp/githubapp/context.go index 5d52a86b..9d72c4ef 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/context.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/context.go @@ -17,7 +17,7 @@ package githubapp import ( "context" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/rs/zerolog" ) diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go b/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go index 522e78df..471d516f 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go @@ -19,7 +19,7 @@ import ( "fmt" "net/http" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/pkg/errors" "github.com/rcrowley/go-metrics" "github.com/rs/zerolog" diff --git a/vendor/github.com/palantir/go-githubapp/githubapp/installations.go b/vendor/github.com/palantir/go-githubapp/githubapp/installations.go index c6870434..70cbbe0b 100644 --- a/vendor/github.com/palantir/go-githubapp/githubapp/installations.go +++ b/vendor/github.com/palantir/go-githubapp/githubapp/installations.go @@ -19,7 +19,7 @@ import ( "fmt" "net/http" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v55/github" "github.com/pkg/errors" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index aa821cf8..71cd6e4b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -37,7 +37,7 @@ github.com/bluekeyes/hatpear # github.com/bluekeyes/templatetree v0.1.0 ## explicit; go 1.11 github.com/bluekeyes/templatetree -# github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 +# github.com/bradleyfalzon/ghinstallation/v2 v2.7.0 ## explicit; go 1.13 github.com/bradleyfalzon/ghinstallation/v2 # github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae @@ -69,9 +69,9 @@ github.com/golang-jwt/jwt/v4 # github.com/golang/protobuf v1.5.3 ## explicit; go 1.9 github.com/golang/protobuf/proto -# github.com/google/go-github/v53 v53.2.0 +# github.com/google/go-github/v55 v55.0.0 ## explicit; go 1.17 -github.com/google/go-github/v53/github +github.com/google/go-github/v55/github # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query @@ -99,8 +99,8 @@ github.com/palantir/go-baseapp/appmetrics/emitter/datadog github.com/palantir/go-baseapp/baseapp github.com/palantir/go-baseapp/baseapp/datadog github.com/palantir/go-baseapp/pkg/errfmt -# github.com/palantir/go-githubapp v0.18.0 -## explicit; go 1.20 +# github.com/palantir/go-githubapp v0.19.0 +## explicit; go 1.21 github.com/palantir/go-githubapp/appconfig github.com/palantir/go-githubapp/githubapp github.com/palantir/go-githubapp/oauth2