Update module github.com/google/go-github/v88 to v89 (#6838)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
renovate[bot]
2026-07-13 23:00:09 +02:00
committed by GitHub
co-authored by lnx01 6543
parent 2bc7837703
commit 40b2bc4c4f
7 changed files with 61 additions and 10 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ require (
github.com/go-sql-driver/mysql v1.10.0
github.com/go-viper/mapstructure/v2 v2.5.0
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/google/go-github/v88 v88.0.0
github.com/google/go-github/v89 v89.0.0
github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-plugin v1.8.0
github.com/jellydator/ttlcache/v3 v3.4.1
+2 -2
View File
@@ -284,8 +284,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/v88 v88.0.0 h1:dZA9IKkPK1eXZj4ypngnpRj5FwdpTv4whix2PrQMP7M=
github.com/google/go-github/v88 v88.0.0/go.mod h1:rufTDgn2N45wjhukLTyxmvc9nilSp3mr3Rgtt6b1MPw=
github.com/google/go-github/v89 v89.0.0 h1:35bEK5XoEcF3PZrlVbl9XN63f5BcJRA/UGkxeC9xPg0=
github.com/google/go-github/v89 v89.0.0/go.mod h1:QLcbU0ipeAqQuR5KSg8c2lql4Qk1EwJ2dWz/0rP4Nho=
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=
+1 -1
View File
@@ -18,7 +18,7 @@ package github
import (
"fmt"
"github.com/google/go-github/v88/github"
"github.com/google/go-github/v89/github"
"go.woodpecker-ci.org/woodpecker/v3/server/model"
)
+1 -1
View File
@@ -18,7 +18,7 @@ package github
import (
"testing"
"github.com/google/go-github/v88/github"
"github.com/google/go-github/v89/github"
"github.com/stretchr/testify/assert"
"go.woodpecker-ci.org/woodpecker/v3/server/model"
+3 -3
View File
@@ -27,7 +27,7 @@ import (
"strings"
"time"
"github.com/google/go-github/v88/github"
"github.com/google/go-github/v89/github"
"github.com/rs/zerolog/log"
"golang.org/x/oauth2"
@@ -588,8 +588,8 @@ func (c *client) Status(ctx context.Context, user *model.User, repo *model.Repo,
}
id, _ := strconv.Atoi(matches[1])
_, _, err := client.Repositories.CreateDeploymentStatus(ctx, repo.Owner, repo.Name, int64(id), &github.DeploymentStatusRequest{
State: github.Ptr(convertStatus(pipeline.Status)),
_, _, err := client.Repositories.CreateDeploymentStatus(ctx, repo.Owner, repo.Name, int64(id), github.DeploymentStatusRequest{
State: convertStatus(pipeline.Status),
Description: github.Ptr(common.GetPipelineStatusDescription(pipeline.Status)),
LogURL: github.Ptr(common.GetPipelineStatusURL(repo, pipeline, nil)),
})
+52 -1
View File
@@ -17,12 +17,14 @@ package github
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/gin-gonic/gin"
"github.com/google/go-github/v88/github"
"github.com/google/go-github/v89/github"
github_mock "github.com/migueleliasweb/go-github-mock/src/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
@@ -95,6 +97,55 @@ func Test_github(t *testing.T) {
})
}
func TestStatusDeployment(t *testing.T) {
var (
method string
path string
decodeErr error
body struct {
State string `json:"state"`
Description string `json:"description"`
LogURL string `json:"log_url"`
}
)
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
method = r.Method
path = r.URL.Path
decodeErr = json.NewDecoder(r.Body).Decode(&body)
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{}`))
}))
t.Cleanup(server.Close)
gh, err := github.NewClient(
github.WithURLs(github.Ptr(server.URL+"/"), nil),
github.WithHTTPClient(server.Client()),
)
require.NoError(t, err)
ctx := context.WithValue(t.Context(), githubClientKey, gh)
c := &client{}
err = c.Status(ctx, fakeUser, &model.Repo{
ID: 7,
Owner: "octocat",
Name: "Hello-World",
}, &model.Pipeline{
Number: 9,
Event: model.EventDeploy,
Status: model.StatusSuccess,
ForgeURL: "https://api.github.com/repos/octocat/Hello-World/deployments/42",
}, nil)
require.NoError(t, err)
assert.Equal(t, http.MethodPost, method)
assert.Equal(t, "/repos/octocat/Hello-World/deployments/42/statuses", path)
require.NoError(t, decodeErr)
assert.Equal(t, "success", body.State)
assert.Equal(t, "Pipeline was successful", body.Description)
assert.Contains(t, body.LogURL, "/repos/7/pipeline/9")
}
var (
fakeUser = &model.User{
Login: "6543",
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"net/http"
"strings"
"github.com/google/go-github/v88/github"
"github.com/google/go-github/v89/github"
"github.com/rs/zerolog/log"
"go.woodpecker-ci.org/woodpecker/v3/server/forge/common"