Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make it so release.sh script doesn't output duplicate change PRs #2735

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hack/release_notes/listpullreqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func printPullRequests() {
fmt.Println(fmt.Sprintf("Collecting pull request that were merged since the last release: %s (%s)", *releases[0].TagName, lastReleaseTime))

listSize := 1
seen := map[int]bool{}

for page := 0; listSize > 0; page++ {
pullRequests, _, _ := client.PullRequests.List(context.Background(), org, repo, &github.PullRequestListOptions{
State: "closed",
Expand All @@ -75,8 +77,9 @@ func printPullRequests() {
for idx := range pullRequests {
pr := pullRequests[idx]
if pr.MergedAt != nil {
if pr.GetMergedAt().After(lastReleaseTime.Time) {
if _, ok := seen[*pr.Number]; !ok && pr.GetMergedAt().After(lastReleaseTime.Time) {
fmt.Printf("* %s [#%d](https://github.com/%s/%s/pull/%d)\n", pr.GetTitle(), *pr.Number, org, repo, *pr.Number)
seen[*pr.Number] = true
}
}
}
Expand Down
Loading