fix(deps): update module github.com/google/go-github/v67 to v68 (#4635)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2024-12-28 09:28:01 +01:00 committed by GitHub
parent 75cd728395
commit 828298bcf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 77 additions and 77 deletions

2
go.mod
View file

@ -30,7 +30,7 @@ require (
github.com/go-sql-driver/mysql v1.8.1 github.com/go-sql-driver/mysql v1.8.1
github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-viper/mapstructure/v2 v2.2.1
github.com/golang-jwt/jwt/v5 v5.2.1 github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-github/v67 v67.0.0 github.com/google/go-github/v68 v68.0.0
github.com/google/tink/go v1.7.0 github.com/google/tink/go v1.7.0
github.com/gorilla/securecookie v1.1.2 github.com/gorilla/securecookie v1.1.2
github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-hclog v1.6.3

4
go.sum
View file

@ -235,8 +235,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.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 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s=
github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= 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/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=

View file

@ -18,7 +18,7 @@ package github
import ( import (
"fmt" "fmt"
"github.com/google/go-github/v67/github" "github.com/google/go-github/v68/github"
"go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/model"
) )

View file

@ -19,7 +19,7 @@ import (
"testing" "testing"
"github.com/franela/goblin" "github.com/franela/goblin"
"github.com/google/go-github/v67/github" "github.com/google/go-github/v68/github"
"go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/model"
) )
@ -66,15 +66,15 @@ func Test_helper(t *testing.T) {
g.It("should convert repository list", func() { g.It("should convert repository list", func() {
from := []*github.Repository{ from := []*github.Repository{
{ {
Private: github.Bool(false), Private: github.Ptr(false),
FullName: github.String("octocat/hello-world"), FullName: github.Ptr("octocat/hello-world"),
Name: github.String("hello-world"), Name: github.Ptr("hello-world"),
Owner: &github.User{ Owner: &github.User{
AvatarURL: github.String("http://..."), AvatarURL: github.Ptr("http://..."),
Login: github.String("octocat"), Login: github.Ptr("octocat"),
}, },
HTMLURL: github.String("https://github.com/octocat/hello-world"), HTMLURL: github.Ptr("https://github.com/octocat/hello-world"),
CloneURL: github.String("https://github.com/octocat/hello-world.git"), CloneURL: github.Ptr("https://github.com/octocat/hello-world.git"),
Permissions: map[string]bool{ Permissions: map[string]bool{
"push": true, "push": true,
"pull": true, "pull": true,
@ -92,15 +92,15 @@ func Test_helper(t *testing.T) {
g.It("should convert repository", func() { g.It("should convert repository", func() {
from := github.Repository{ from := github.Repository{
FullName: github.String("octocat/hello-world"), FullName: github.Ptr("octocat/hello-world"),
Name: github.String("hello-world"), Name: github.Ptr("hello-world"),
HTMLURL: github.String("https://github.com/octocat/hello-world"), HTMLURL: github.Ptr("https://github.com/octocat/hello-world"),
CloneURL: github.String("https://github.com/octocat/hello-world.git"), CloneURL: github.Ptr("https://github.com/octocat/hello-world.git"),
DefaultBranch: github.String("develop"), DefaultBranch: github.Ptr("develop"),
Private: github.Bool(true), Private: github.Ptr(true),
Owner: &github.User{ Owner: &github.User{
AvatarURL: github.String("http://..."), AvatarURL: github.Ptr("http://..."),
Login: github.String("octocat"), Login: github.Ptr("octocat"),
}, },
Permissions: map[string]bool{ Permissions: map[string]bool{
"push": true, "push": true,
@ -137,8 +137,8 @@ func Test_helper(t *testing.T) {
g.It("should convert team", func() { g.It("should convert team", func() {
from := &github.Organization{ from := &github.Organization{
Login: github.String("octocat"), Login: github.Ptr("octocat"),
AvatarURL: github.String("http://..."), AvatarURL: github.Ptr("http://..."),
} }
to := convertTeam(from) to := convertTeam(from)
g.Assert(to.Login).Equal("octocat") g.Assert(to.Login).Equal("octocat")
@ -148,8 +148,8 @@ func Test_helper(t *testing.T) {
g.It("should convert team list", func() { g.It("should convert team list", func() {
from := []*github.Organization{ from := []*github.Organization{
{ {
Login: github.String("octocat"), Login: github.Ptr("octocat"),
AvatarURL: github.String("http://..."), AvatarURL: github.Ptr("http://..."),
}, },
} }
to := convertTeamList(from) to := convertTeamList(from)
@ -159,14 +159,14 @@ func Test_helper(t *testing.T) {
g.It("should convert a repository from webhook", func() { g.It("should convert a repository from webhook", func() {
from := &github.PushEventRepository{Owner: &github.User{}} from := &github.PushEventRepository{Owner: &github.User{}}
from.Owner.Login = github.String("octocat") from.Owner.Login = github.Ptr("octocat")
from.Owner.Name = github.String("octocat") from.Owner.Name = github.Ptr("octocat")
from.Name = github.String("hello-world") from.Name = github.Ptr("hello-world")
from.FullName = github.String("octocat/hello-world") from.FullName = github.Ptr("octocat/hello-world")
from.Private = github.Bool(true) from.Private = github.Ptr(true)
from.HTMLURL = github.String("https://github.com/octocat/hello-world") from.HTMLURL = github.Ptr("https://github.com/octocat/hello-world")
from.CloneURL = github.String("https://github.com/octocat/hello-world.git") from.CloneURL = github.Ptr("https://github.com/octocat/hello-world.git")
from.DefaultBranch = github.String("develop") from.DefaultBranch = github.Ptr("develop")
repo := convertRepoHook(from) repo := convertRepoHook(from)
g.Assert(repo.Owner).Equal(*from.Owner.Login) g.Assert(repo.Owner).Equal(*from.Owner.Login)
@ -180,28 +180,28 @@ func Test_helper(t *testing.T) {
g.It("should convert a pull request from webhook", func() { g.It("should convert a pull request from webhook", func() {
from := &github.PullRequestEvent{ from := &github.PullRequestEvent{
Action: github.String(actionOpen), Action: github.Ptr(actionOpen),
PullRequest: &github.PullRequest{ PullRequest: &github.PullRequest{
State: github.String(stateOpen), State: github.Ptr(stateOpen),
HTMLURL: github.String("https://github.com/octocat/hello-world/pulls/42"), HTMLURL: github.Ptr("https://github.com/octocat/hello-world/pulls/42"),
Number: github.Int(42), Number: github.Ptr(42),
Title: github.String("Updated README.md"), Title: github.Ptr("Updated README.md"),
Base: &github.PullRequestBranch{ Base: &github.PullRequestBranch{
Ref: github.String("main"), Ref: github.Ptr("main"),
}, },
Head: &github.PullRequestBranch{ Head: &github.PullRequestBranch{
Ref: github.String("changes"), Ref: github.Ptr("changes"),
SHA: github.String("f72fc19"), SHA: github.Ptr("f72fc19"),
Repo: &github.Repository{ Repo: &github.Repository{
CloneURL: github.String("https://github.com/octocat/hello-world-fork"), CloneURL: github.Ptr("https://github.com/octocat/hello-world-fork"),
}, },
}, },
User: &github.User{ User: &github.User{
Login: github.String("octocat"), Login: github.Ptr("octocat"),
AvatarURL: github.String("https://avatars1.githubusercontent.com/u/583231"), AvatarURL: github.Ptr("https://avatars1.githubusercontent.com/u/583231"),
}, },
}, Sender: &github.User{ }, Sender: &github.User{
Login: github.String("octocat"), Login: github.Ptr("octocat"),
}, },
} }
pull, _, pipeline, err := parsePullHook(from, true) pull, _, pipeline, err := parsePullHook(from, true)
@ -221,15 +221,15 @@ func Test_helper(t *testing.T) {
g.It("should convert a deployment from webhook", func() { g.It("should convert a deployment from webhook", func() {
from := &github.DeploymentEvent{Deployment: &github.Deployment{}, Sender: &github.User{}} from := &github.DeploymentEvent{Deployment: &github.Deployment{}, Sender: &github.User{}}
from.Deployment.Description = github.String(":shipit:") from.Deployment.Description = github.Ptr(":shipit:")
from.Deployment.Environment = github.String("production") from.Deployment.Environment = github.Ptr("production")
from.Deployment.Task = github.String("deploy") from.Deployment.Task = github.Ptr("deploy")
from.Deployment.ID = github.Int64(42) from.Deployment.ID = github.Ptr(int64(42))
from.Deployment.Ref = github.String("main") from.Deployment.Ref = github.Ptr("main")
from.Deployment.SHA = github.String("f72fc19") from.Deployment.SHA = github.Ptr("f72fc19")
from.Deployment.URL = github.String("https://github.com/octocat/hello-world") from.Deployment.URL = github.Ptr("https://github.com/octocat/hello-world")
from.Sender.Login = github.String("octocat") from.Sender.Login = github.Ptr("octocat")
from.Sender.AvatarURL = github.String("https://avatars1.githubusercontent.com/u/583231") from.Sender.AvatarURL = github.Ptr("https://avatars1.githubusercontent.com/u/583231")
_, pipeline := parseDeployHook(from) _, pipeline := parseDeployHook(from)
g.Assert(pipeline.Event).Equal(model.EventDeploy) g.Assert(pipeline.Event).Equal(model.EventDeploy)
@ -244,14 +244,14 @@ func Test_helper(t *testing.T) {
g.It("should convert a push from webhook", func() { g.It("should convert a push from webhook", func() {
from := &github.PushEvent{Sender: &github.User{}, Repo: &github.PushEventRepository{}, HeadCommit: &github.HeadCommit{Author: &github.CommitAuthor{}}} from := &github.PushEvent{Sender: &github.User{}, Repo: &github.PushEventRepository{}, HeadCommit: &github.HeadCommit{Author: &github.CommitAuthor{}}}
from.Sender.Login = github.String("octocat") from.Sender.Login = github.Ptr("octocat")
from.Sender.AvatarURL = github.String("https://avatars1.githubusercontent.com/u/583231") from.Sender.AvatarURL = github.Ptr("https://avatars1.githubusercontent.com/u/583231")
from.Repo.CloneURL = github.String("https://github.com/octocat/hello-world.git") from.Repo.CloneURL = github.Ptr("https://github.com/octocat/hello-world.git")
from.HeadCommit.Author.Email = github.String("github.String(octocat@github.com") from.HeadCommit.Author.Email = github.Ptr("github.Ptr(octocat@github.com")
from.HeadCommit.Message = github.String("updated README.md") from.HeadCommit.Message = github.Ptr("updated README.md")
from.HeadCommit.URL = github.String("https://github.com/octocat/hello-world") from.HeadCommit.URL = github.Ptr("https://github.com/octocat/hello-world")
from.HeadCommit.ID = github.String("f72fc19") from.HeadCommit.ID = github.Ptr("f72fc19")
from.Ref = github.String("refs/heads/main") from.Ref = github.Ptr("refs/heads/main")
_, pipeline := parsePushHook(from) _, pipeline := parsePushHook(from)
g.Assert(pipeline.Event).Equal(model.EventPush) g.Assert(pipeline.Event).Equal(model.EventPush)
@ -267,7 +267,7 @@ func Test_helper(t *testing.T) {
g.It("should convert a tag from webhook", func() { g.It("should convert a tag from webhook", func() {
from := &github.PushEvent{} from := &github.PushEvent{}
from.Ref = github.String("refs/tags/v1.0.0") from.Ref = github.Ptr("refs/tags/v1.0.0")
_, pipeline := parsePushHook(from) _, pipeline := parsePushHook(from)
g.Assert(pipeline.Event).Equal(model.EventTag) g.Assert(pipeline.Event).Equal(model.EventTag)
@ -276,8 +276,8 @@ func Test_helper(t *testing.T) {
g.It("should convert tag's base branch from webhook to pipeline's branch ", func() { g.It("should convert tag's base branch from webhook to pipeline's branch ", func() {
from := &github.PushEvent{} from := &github.PushEvent{}
from.Ref = github.String("refs/tags/v1.0.0") from.Ref = github.Ptr("refs/tags/v1.0.0")
from.BaseRef = github.String("refs/heads/main") from.BaseRef = github.Ptr("refs/heads/main")
_, pipeline := parsePushHook(from) _, pipeline := parsePushHook(from)
g.Assert(pipeline.Event).Equal(model.EventTag) g.Assert(pipeline.Event).Equal(model.EventTag)
@ -286,8 +286,8 @@ func Test_helper(t *testing.T) {
g.It("should not convert tag's base_ref from webhook if not prefixed with 'ref/heads/'", func() { g.It("should not convert tag's base_ref from webhook if not prefixed with 'ref/heads/'", func() {
from := &github.PushEvent{} from := &github.PushEvent{}
from.Ref = github.String("refs/tags/v1.0.0") from.Ref = github.Ptr("refs/tags/v1.0.0")
from.BaseRef = github.String("refs/refs/main") from.BaseRef = github.Ptr("refs/refs/main")
_, pipeline := parsePushHook(from) _, pipeline := parsePushHook(from)
g.Assert(pipeline.Event).Equal(model.EventTag) g.Assert(pipeline.Event).Equal(model.EventTag)

View file

@ -27,7 +27,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/google/go-github/v67/github" "github.com/google/go-github/v68/github"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@ -529,18 +529,18 @@ func (c *client) Status(ctx context.Context, user *model.User, repo *model.Repo,
id, _ := strconv.Atoi(matches[1]) id, _ := strconv.Atoi(matches[1])
_, _, err := client.Repositories.CreateDeploymentStatus(ctx, repo.Owner, repo.Name, int64(id), &github.DeploymentStatusRequest{ _, _, err := client.Repositories.CreateDeploymentStatus(ctx, repo.Owner, repo.Name, int64(id), &github.DeploymentStatusRequest{
State: github.String(convertStatus(pipeline.Status)), State: github.Ptr(convertStatus(pipeline.Status)),
Description: github.String(common.GetPipelineStatusDescription(pipeline.Status)), Description: github.Ptr(common.GetPipelineStatusDescription(pipeline.Status)),
LogURL: github.String(common.GetPipelineStatusURL(repo, pipeline, nil)), LogURL: github.Ptr(common.GetPipelineStatusURL(repo, pipeline, nil)),
}) })
return err return err
} }
_, _, err := client.Repositories.CreateStatus(ctx, repo.Owner, repo.Name, pipeline.Commit, &github.RepoStatus{ _, _, err := client.Repositories.CreateStatus(ctx, repo.Owner, repo.Name, pipeline.Commit, &github.RepoStatus{
Context: github.String(common.GetPipelineStatusContext(repo, pipeline, workflow)), Context: github.Ptr(common.GetPipelineStatusContext(repo, pipeline, workflow)),
State: github.String(convertStatus(workflow.State)), State: github.Ptr(convertStatus(workflow.State)),
Description: github.String(common.GetPipelineStatusDescription(workflow.State)), Description: github.Ptr(common.GetPipelineStatusDescription(workflow.State)),
TargetURL: github.String(common.GetPipelineStatusURL(repo, pipeline, workflow)), TargetURL: github.Ptr(common.GetPipelineStatusURL(repo, pipeline, workflow)),
}) })
return err return err
} }
@ -553,7 +553,7 @@ func (c *client) Activate(ctx context.Context, u *model.User, r *model.Repo, lin
} }
client := c.newClientToken(ctx, u.AccessToken) client := c.newClientToken(ctx, u.AccessToken)
hook := &github.Hook{ hook := &github.Hook{
Name: github.String("web"), Name: github.Ptr("web"),
Events: []string{ Events: []string{
"push", "push",
"pull_request", "pull_request",
@ -561,7 +561,7 @@ func (c *client) Activate(ctx context.Context, u *model.User, r *model.Repo, lin
}, },
Config: &github.HookConfig{ Config: &github.HookConfig{
URL: &link, URL: &link,
ContentType: github.String("form"), ContentType: github.Ptr("form"),
}, },
} }
_, _, err := client.Repositories.CreateHook(ctx, r.Owner, r.Name, hook) _, _, err := client.Repositories.CreateHook(ctx, r.Owner, r.Name, hook)

View file

@ -22,7 +22,7 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/google/go-github/v67/github" "github.com/google/go-github/v68/github"
"go.woodpecker-ci.org/woodpecker/v3/server/forge/types" "go.woodpecker-ci.org/woodpecker/v3/server/forge/types"
"go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/model"