fix: Get the same behavior described in Docs(#71)

Now trying read body path first then falling back on body
This commit is contained in:
yin1999 2021-03-20 08:31:50 +08:00
parent affa18ef97
commit 77903b197f
No known key found for this signature in database
GPG key ID: 29A80EEAAFA37A22
2 changed files with 4 additions and 4 deletions

View file

@ -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( assert.equal(
"foo", "bar",
releaseBody({ releaseBody({
github_ref: "", github_ref: "",
github_repository: "", github_repository: "",

View file

@ -19,9 +19,9 @@ export interface Config {
export const releaseBody = (config: Config): string | undefined => { export const releaseBody = (config: Config): string | undefined => {
return ( return (
config.input_body ||
(config.input_body_path && (config.input_body_path &&
readFileSync(config.input_body_path).toString("utf8")) readFileSync(config.input_body_path).toString("utf8")) ||
config.input_body
); );
}; };