Skip to content

Commit

Permalink
fix duplicate prs
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Oct 4, 2023
1 parent 2f61a5b commit f833a24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lambdas/GHHooks/EventHandler/Handlers/ReleaseReporter.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import GitHubAPI
import DiscordBM
import Logging
import Algorithms
import Foundation

struct ReleaseReporter {
Expand Down Expand Up @@ -66,7 +67,7 @@ struct ReleaseReporter {
}
}

func getPRsRelatedToRelease() async throws -> (commits: Int, somePRs: [SimplePullRequest]) {
func getPRsRelatedToRelease() async throws -> (Int, [SimplePullRequest]) {
let commits: [Commit]
if let tagBefore = try await getTagBefore() {
commits = try await getCommitsInRelease(tagBefore: tagBefore)
Expand All @@ -83,6 +84,7 @@ struct ReleaseReporter {
let newPRs = try await getPRsRelatedToCommit(sha: commit.sha)
prs.append(contentsOf: newPRs)
}
prs = prs.uniqued(on: \.html_url)

return (commits.count, prs)
}
Expand Down

0 comments on commit f833a24

Please sign in to comment.