From 6a33483647d0b76ed169ac856a86292406459de9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 08:52:23 +0100 Subject: [PATCH] fix(deps): update module github.com/google/go-github/v81 to v82 (#6047) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: qwerty287 --- go.mod | 2 +- go.sum | 4 ++-- server/forge/github/convert.go | 10 +++++----- server/forge/github/convert_test.go | 26 +++++++++++++------------- server/forge/github/github.go | 2 +- server/forge/github/github_test.go | 2 +- server/forge/github/parse.go | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 1885bfed5..67fdeaddf 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/go-sql-driver/mysql v1.9.3 github.com/go-viper/mapstructure/v2 v2.5.0 github.com/golang-jwt/jwt/v5 v5.3.1 - github.com/google/go-github/v81 v81.0.0 + github.com/google/go-github/v82 v82.0.0 github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-plugin v1.7.0 github.com/jellydator/ttlcache/v3 v3.4.0 diff --git a/go.sum b/go.sum index 4802b07fb..0a0ac7ae8 100644 --- a/go.sum +++ b/go.sum @@ -253,8 +253,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v73 v73.0.0 h1:aR+Utnh+Y4mMkS+2qLQwcQ/cF9mOTpdwnzlaw//rG24= github.com/google/go-github/v73 v73.0.0/go.mod h1:fa6w8+/V+edSU0muqdhCVY7Beh1M8F1IlQPZIANKIYw= -github.com/google/go-github/v81 v81.0.0 h1:hTLugQRxSLD1Yei18fk4A5eYjOGLUBKAl/VCqOfFkZc= -github.com/google/go-github/v81 v81.0.0/go.mod h1:upyjaybucIbBIuxgJS7YLOZGziyvvJ92WX6WEBNE3sM= +github.com/google/go-github/v82 v82.0.0 h1:OH09ESON2QwKCUVMYmMcVu1IFKFoaZHwqYaUtr/MVfk= +github.com/google/go-github/v82 v82.0.0/go.mod h1:hQ6Xo0VKfL8RZ7z1hSfB4fvISg0QqHOqe9BP0qo+WvM= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= 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 3dc2d628d..beb07c609 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/v81/github" + "github.com/google/go-github/v82/github" "go.woodpecker-ci.org/woodpecker/v3/server/model" ) @@ -101,11 +101,11 @@ func convertRepo(from *github.Repository) *model.Repo { // convertPerm is a helper function used to convert a GitHub repository // permissions to the common Woodpecker permissions structure. -func convertPerm(perm map[string]bool) *model.Perm { +func convertPerm(perm *github.RepositoryPermissions) *model.Perm { return &model.Perm{ - Admin: perm["admin"], - Push: perm["push"], - Pull: perm["pull"], + Admin: perm.GetAdmin(), + Push: perm.GetPush(), + Pull: perm.GetPull(), } } diff --git a/server/forge/github/convert_test.go b/server/forge/github/convert_test.go index 8f4a73cb8..cbdfedcfb 100644 --- a/server/forge/github/convert_test.go +++ b/server/forge/github/convert_test.go @@ -18,7 +18,7 @@ package github import ( "testing" - "github.com/google/go-github/v81/github" + "github.com/google/go-github/v82/github" "github.com/stretchr/testify/assert" "go.woodpecker-ci.org/woodpecker/v3/server/model" @@ -54,10 +54,10 @@ func Test_convertRepoList(t *testing.T) { }, HTMLURL: github.Ptr("https://github.com/octocat/hello-world"), CloneURL: github.Ptr("https://github.com/octocat/hello-world.git"), - Permissions: map[string]bool{ - "push": true, - "pull": true, - "admin": true, + Permissions: &github.RepositoryPermissions{ + Admin: github.Ptr(true), + Push: github.Ptr(true), + Pull: github.Ptr(true), }, }, } @@ -81,10 +81,10 @@ func Test_convertRepo(t *testing.T) { AvatarURL: github.Ptr("http://..."), Login: github.Ptr("octocat"), }, - Permissions: map[string]bool{ - "push": true, - "pull": true, - "admin": true, + Permissions: &github.RepositoryPermissions{ + Admin: github.Ptr(true), + Push: github.Ptr(true), + Pull: github.Ptr(true), }, } @@ -101,10 +101,10 @@ func Test_convertRepo(t *testing.T) { func Test_convertPerm(t *testing.T) { from := &github.Repository{ - Permissions: map[string]bool{ - "admin": true, - "push": true, - "pull": true, + Permissions: &github.RepositoryPermissions{ + Admin: github.Ptr(true), + Push: github.Ptr(true), + Pull: github.Ptr(true), }, } diff --git a/server/forge/github/github.go b/server/forge/github/github.go index eeca51c67..a22722e53 100644 --- a/server/forge/github/github.go +++ b/server/forge/github/github.go @@ -27,7 +27,7 @@ import ( "strings" "time" - "github.com/google/go-github/v81/github" + "github.com/google/go-github/v82/github" "github.com/rs/zerolog/log" "golang.org/x/oauth2" diff --git a/server/forge/github/github_test.go b/server/forge/github/github_test.go index 95c624a69..fe4f7ef9c 100644 --- a/server/forge/github/github_test.go +++ b/server/forge/github/github_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/google/go-github/v81/github" + "github.com/google/go-github/v82/github" gh_mock "github.com/migueleliasweb/go-github-mock/src/mock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/server/forge/github/parse.go b/server/forge/github/parse.go index 4fe9105c1..a6c3dd028 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/v81/github" + "github.com/google/go-github/v82/github" "go.woodpecker-ci.org/woodpecker/v3/server/forge/common" "go.woodpecker-ci.org/woodpecker/v3/server/forge/types"