Skip to content

Commit

Permalink
fix: Get the same behavior described in Docs(#71) (#85)
Browse files Browse the repository at this point in the history
Now trying read body path first then falling back on body
  • Loading branch information
yin1999 committed Mar 21, 2021
1 parent affa18e commit dac15d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions __tests__/util.test.ts
Expand Up @@ -58,9 +58,9 @@ describe("util", () => {
})
);
});
it("defaults to body when both body and body path are provided", () => {
it("defaults to body path when both body and body path are provided", () => {
assert.equal(
"foo",
"bar",
releaseBody({
github_ref: "",
github_repository: "",
Expand Down
4 changes: 2 additions & 2 deletions src/util.ts
Expand Up @@ -19,9 +19,9 @@ export interface Config {

export const releaseBody = (config: Config): string | undefined => {
return (
config.input_body ||
(config.input_body_path &&
readFileSync(config.input_body_path).toString("utf8"))
readFileSync(config.input_body_path).toString("utf8")) ||
config.input_body
);
};

Expand Down

0 comments on commit dac15d3

Please sign in to comment.