diff --git a/src/ordnungsamt/render.clj b/src/ordnungsamt/render.clj index a0b092d..3c36d76 100644 --- a/src/ordnungsamt/render.clj +++ b/src/ordnungsamt/render.clj @@ -1,11 +1,13 @@ (ns ordnungsamt.render (:require [clojure.string] [ordnungsamt.utils :as utils] - [selmer.parser :as selmer] + [selmer.parser] [selmer.util :refer [without-escaping]])) (defn render-title [context] - (selmer.parser/render "[Auto] Refactors - {{date}}" context)) + (if (-> context :migrations count (= 1)) + (selmer.parser/render "[Auto] {{title}}" (-> context :migrations first)) + (selmer.parser/render "[Auto] Refactors - {{date}}" context))) (def migration-template "## {{title}} [{{created-at}}] diff --git a/test/integration/integration/apply_migrations_test.clj b/test/integration/integration/apply_migrations_test.clj index 18c65d8..f3dda38 100644 --- a/test/integration/integration/apply_migrations_test.clj +++ b/test/integration/integration/apply_migrations_test.clj @@ -35,7 +35,7 @@ (and (= (:path request) (str "/repos/" org "/" repository "/pulls")) (standalone/match? - {:title #(clojure.string/starts-with? % title-prefix) + {:title #(or (clojure.string/starts-with? % title-prefix) (clojure.string/includes? % (-> migrations first :title))) :body (fn [txt] (every? (partial includes-migration-info? txt) migrations))} (json/parse-string (:body request) keyword)))))