Merge branch 'origin/main' into 'next-release/main'

This commit is contained in:
oauth
2026-01-31 07:53:16 +00:00
7 changed files with 24 additions and 24 deletions

2
go.mod
View File

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

4
go.sum
View File

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

View File

@@ -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(),
}
}

View File

@@ -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),
},
}

View File

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

View File

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

View File

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