From 5d98a717acf386477f7b676aac5e78005d5c4c4a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 09:37:08 +0100 Subject: [PATCH] fix(deps): update module github.com/google/go-github/v59 to v60 (#3493) --- go.mod | 2 +- go.sum | 4 ++-- server/forge/github/convert.go | 2 +- server/forge/github/convert_test.go | 2 +- server/forge/github/github.go | 18 +++++------------- server/forge/github/parse.go | 2 +- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 282d66cdb..9472df76f 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/go-ap/httpsig v0.0.0-20221203064646-3647b4d88fdf github.com/go-sql-driver/mysql v1.8.0 github.com/golang-jwt/jwt/v5 v5.2.1 - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 github.com/google/tink/go v1.7.0 github.com/gorilla/securecookie v1.1.2 github.com/jellydator/ttlcache/v3 v3.2.0 diff --git a/go.sum b/go.sum index 5847d7af1..2ac5df40e 100644 --- a/go.sum +++ b/go.sum @@ -185,8 +185,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA= -github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM= +github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= +github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/server/forge/github/convert.go b/server/forge/github/convert.go index e17d3aa81..5fcc352ab 100644 --- a/server/forge/github/convert.go +++ b/server/forge/github/convert.go @@ -18,7 +18,7 @@ package github import ( "fmt" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "go.woodpecker-ci.org/woodpecker/v2/server/model" ) diff --git a/server/forge/github/convert_test.go b/server/forge/github/convert_test.go index 7475b71ba..7894cd00b 100644 --- a/server/forge/github/convert_test.go +++ b/server/forge/github/convert_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/franela/goblin" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "go.woodpecker-ci.org/woodpecker/v2/server/model" ) diff --git a/server/forge/github/github.go b/server/forge/github/github.go index e272b0f34..278b91401 100644 --- a/server/forge/github/github.go +++ b/server/forge/github/github.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "github.com/rs/zerolog/log" "golang.org/x/oauth2" @@ -465,15 +465,7 @@ func matchingHooks(hooks []*github.Hook, rawurl string) *github.Hook { if hook.ID == nil { continue } - v, ok := hook.Config["url"] - if !ok { - continue - } - s, ok := v.(string) - if !ok { - continue - } - hookURL, err := url.Parse(s) + hookURL, err := url.Parse(hook.Config.GetURL()) if err == nil && hookURL.Host == link.Host { return hook } @@ -528,9 +520,9 @@ func (c *client) Activate(ctx context.Context, u *model.User, r *model.Repo, lin "pull_request", "deployment", }, - Config: map[string]any{ - "url": link, - "content_type": "form", + Config: &github.HookConfig{ + URL: &link, + ContentType: github.String("form"), }, } _, _, err := client.Repositories.CreateHook(ctx, r.Owner, r.Name, hook) diff --git a/server/forge/github/parse.go b/server/forge/github/parse.go index 8337982dc..4d47b10cc 100644 --- a/server/forge/github/parse.go +++ b/server/forge/github/parse.go @@ -22,7 +22,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "go.woodpecker-ci.org/woodpecker/v2/server/forge/types" "go.woodpecker-ci.org/woodpecker/v2/server/model"