Skip to content

Commit

Permalink
fix: make it so release.sh script doesn't output duplicate change PRs (
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-prindle authored Sep 20, 2023
1 parent 3d1ad4c commit 8c09eff
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 8c09eff

Please sign in to comment.