From 77903b197fe7c4e36049d99301c4dff51aeed175 Mon Sep 17 00:00:00 2001 From: yin1999 <15844309+yin1999@users.noreply.github.com> Date: Sat, 20 Mar 2021 08:31:50 +0800 Subject: [PATCH] fix: Get the same behavior described in Docs(#71) Now trying read body path first then falling back on body --- __tests__/util.test.ts | 4 ++-- src/util.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/util.test.ts b/__tests__/util.test.ts index 5a7a26884..a2efd9e28 100644 --- a/__tests__/util.test.ts +++ b/__tests__/util.test.ts @@ -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: "", diff --git a/src/util.ts b/src/util.ts index 6c1dce971..972b346f6 100644 --- a/src/util.ts +++ b/src/util.ts @@ -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 ); };