Skip to content

Commit

Permalink
fix(summary): Remove extra newline after when given an empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
rymndhng committed Oct 29, 2021
1 parent 10ad153 commit 2af2de9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/release_on_push_action/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@

body (with-out-str
(printf "Version %s\n\n" next-version)
(when-let [body (:input/release-body context)]
(println body))
(when-let [body (not-empty (:input/release-body context))]
(println body)
(println))

;; Do not include our custom commit summary if using Github Release Notes
(when-not (:input/use-github-release-notes context)
Expand Down
6 changes: 2 additions & 4 deletions test/release_on_push_action/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
:tag_name "0.1.0"
:body "Version 0.1.0
### Commits
- [946550e6] Commit 10
Expand Down Expand Up @@ -126,7 +125,7 @@ Hello World
- [74ffa7bf] Commit 7
- [536a71ab] Commit 6
"
(-> (assoc ctx :input/release-body "Hello World\n")
(-> (assoc ctx :input/release-body "Hello World")
(sut/generate-new-release-data related-data)
(get :body)))))

Expand Down Expand Up @@ -158,7 +157,6 @@ Hello World
;; note that commit 6 is not included here
:body "Version 0.2.0
### Commits
- [946550e6] Commit 10
Expand Down Expand Up @@ -197,7 +195,7 @@ Hello World
- [2af2e1d6] Commit 8
- [74ffa7bf] Commit 7
"
(-> (assoc ctx :input/release-body "Hello World\n")
(-> (assoc ctx :input/release-body "Hello World")
(sut/generate-new-release-data related-data)
(get :body)))))
(testing ":input/max-commits"
Expand Down

0 comments on commit 2af2de9

Please sign in to comment.