From 9cdf2cd6199c8486e94c3152234fa382dc4c821a Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Wed, 28 Mar 2018 21:04:58 +0300 Subject: [PATCH] Iterate through return value of extract-issue-number instead of picking first always --- src/clj/commiteth/routes/webhooks.clj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/clj/commiteth/routes/webhooks.clj b/src/clj/commiteth/routes/webhooks.clj index 3a7e44f..a3728a7 100644 --- a/src/clj/commiteth/routes/webhooks.clj +++ b/src/clj/commiteth/routes/webhooks.clj @@ -174,9 +174,7 @@ pr-body :body pr-title :title} :pull_request}] (log/info "handle-pull-request-event" event-type owner repo repo-id login pr-body pr-title) - (if-let [issue (some->> (extract-issue-number owner repo pr-body pr-title) - (first) - (issues/get-issue repo-id))] + (if-let [issue (some #(issues/get-issue repo-id %1) (extract-issue-number owner repo pr-body pr-title))] (if-not (:commit_sha issue) ; no PR has been merged yet referencing this issue (do (log/info "Referenced bounty issue found" owner repo (:issue_number issue))