Skip to content

Commit f022f61

Browse files
committed
call existing-pr rightly
1 parent 902549e commit f022f61

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

script/update_or_create_pr.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
(let [pr-json
1515
(slurp
1616
(-> (str "https://api.github.com/repos/metabase/docs.metabase.github.io/pulls?head=metabase:" target-branch)
17-
(shell {:out :string :continue true})))]
18-
(some #(when (= target-branch (% "title")) (% "number"))
19-
(json/parse-string pr-json))))
17+
(shell {:out :string :continue true})))
18+
_ (println "→ PR JSON:" pr-json)
19+
o (some #(when (= target-branch (% "title")) (% "number"))
20+
(json/parse-string pr-json))]
21+
(println "→ PR number:" o)
22+
(boolean o)))
2023

2124
(defn -main [& args]
2225
(let [source-branch (or (first args) (usage))
@@ -38,7 +41,7 @@
3841

3942
(println "→ Checking for existing PR...")
4043

41-
(if (existing-pr?)
44+
(if (existing-pr? target-branch)
4245
(println "✓ PR already exists: #" existing-pr?)
4346
(do
4447
(println "→ Creating new PR...")

0 commit comments

Comments
 (0)