Skip to content

Commit

Permalink
Upgrade go-github to v54
Browse files Browse the repository at this point in the history
  • Loading branch information
superbrothers committed Aug 24, 2023
1 parent 8475df2 commit 5972f19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/bradleyfalzon/ghinstallation/v2 v2.6.0
github.com/gin-gonic/gin v1.9.1
github.com/google/go-github/v43 v43.0.0
github.com/google/go-github/v54 v54.0.0
github.com/prometheus/client_golang v1.16.0
github.com/rs/zerolog v1.30.0
github.com/stretchr/testify v1.8.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v43 v43.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U=
github.com/google/go-github/v43 v43.0.0/go.mod h1:ZkTvvmCXBvsfPpTHXnH/d2hP9Y0cTbvN9kr5xqyXOIc=
github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI=
github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao=
github.com/google/go-github/v54 v54.0.0 h1:OZdXwow4EAD5jEo5qg+dGFH2DpkyZvVsAehjvJuUL/c=
github.com/google/go-github/v54 v54.0.0/go.mod h1:Sw1LXWHhXRZtzJ9LI5fyJg9wbQzYvFhW8W5P2yaAQ7s=
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=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"

"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/google/go-github/v43/github"
"github.com/google/go-github/v54/github"
"github.com/pfnet-research/alertmanager-to-github/pkg/notifier"
"github.com/pfnet-research/alertmanager-to-github/pkg/server"
"github.com/pfnet-research/alertmanager-to-github/pkg/template"
Expand Down
6 changes: 3 additions & 3 deletions pkg/notifier/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"strings"

"github.com/google/go-github/v43/github"
"github.com/google/go-github/v54/github"
"github.com/pfnet-research/alertmanager-to-github/pkg/template"
"github.com/pfnet-research/alertmanager-to-github/pkg/types"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -127,7 +127,7 @@ func (n *GitHubNotifier) Notify(ctx context.Context, payload *types.WebhookPaylo
Str("groupKey", payload.GroupKey).Msg("too many search result")

for _, i := range searchResult.Issues {
if issue == nil || issue.GetCreatedAt().Before(i.GetCreatedAt()) {
if issue == nil || issue.GetCreatedAt().Before(i.GetCreatedAt().Time) {
issue = i
}
}
Expand Down Expand Up @@ -241,7 +241,7 @@ func (n *GitHubNotifier) cleanupIssues(ctx context.Context, owner, repo, alertID
}

sort.Slice(issues, func(i, j int) bool {
return issues[i].GetCreatedAt().Before(issues[j].GetCreatedAt())
return issues[i].GetCreatedAt().Before(issues[j].GetCreatedAt().Time)
})

latestIssue := issues[len(issues)-1]
Expand Down

0 comments on commit 5972f19

Please sign in to comment.