Skip to content

Commit

Permalink
Merge pull request #241 from kyontan/main
Browse files Browse the repository at this point in the history
Fix not removing stale labels if there are too many labels in the pull request
  • Loading branch information
suzuki-shunsuke authored Apr 6, 2022
2 parents 809b961 + 9c2011f commit 48ac940
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/notifier/github/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/http"
"os"

"github.com/google/go-github/v39/github"
"github.com/sirupsen/logrus"
"github.com/suzuki-shunsuke/github-comment-metadata/metadata"
"github.com/suzuki-shunsuke/tfcmt/pkg/notifier"
Expand Down Expand Up @@ -214,7 +215,10 @@ func (g *NotifyService) updateLabels(ctx context.Context, result terraform.Parse

func (g *NotifyService) removeResultLabels(ctx context.Context, label string) (string, error) {
cfg := g.client.Config
labels, _, err := g.client.API.IssuesListLabels(ctx, cfg.PR.Number, nil)
// A Pull Request can have 100 labels the maximum
labels, _, err := g.client.API.IssuesListLabels(ctx, cfg.PR.Number, &github.ListOptions{
PerPage: 100, //nolint:gomnd
})
if err != nil {
return "", err
}
Expand Down

0 comments on commit 48ac940

Please sign in to comment.