From acb24beb3410fab3875ad3da92262f3622705264 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Fri, 27 Nov 2020 16:09:48 +0100 Subject: [PATCH 1/2] Output commit message title and body --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 1404df5..8bcfe5f 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,12 @@ try { throw err; } core.setOutput("git-message", stdout); + + const lines = stdout.split("\n"); + const title = lines.shift(); + const body = lines.join("\n"); + core.setOutput("title", title); + core.setOutput("body", body); }); } catch (error) { core.setFailed(error.message); From c925ed4956642800db2bddac5f62da36457b7b35 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Fri, 27 Nov 2020 16:24:57 +0100 Subject: [PATCH 2/2] Update outputs in README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e9fd12c..72e47b7 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,14 @@ This action outputs the git message associated with the current SHA The git-message +### `title` + +The title of the git-message, i.e. the first line + +### `body` + +The body of the git-message, i.e. everything but the first line + ## Example usage Without SHA: ```