Iterate through return value of extract-issue-number instead of picking

first always
This commit is contained in:
Vitaliy Vlasov 2018-03-28 21:04:58 +03:00
parent 3b1d5f70c7
commit 9cdf2cd619
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
1 changed files with 1 additions and 3 deletions

View File

@ -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))