Skip to content

Commit

Permalink
feat: output message title and body
Browse files Browse the repository at this point in the history
  • Loading branch information
kceb authored Aug 26, 2021
2 parents 3ad18ab + c925ed4 commit bf20691
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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);
Expand Down

0 comments on commit bf20691

Please sign in to comment.