From 175b44e02b111343bbbfb0a557044ea9ee479520 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Thu, 13 May 2021 17:18:19 +0100 Subject: [PATCH] Ignore null release body Using the SOLIDSoftworks/semver-tags action will result in a release created that doesn't contain anything for the release body. The consequences is that the updated release body will appear to contain the string `null` followed by a newline and then the release body as specified for this action. In such a case it appears to make more sense to ignore the existing release body should it be currently `null` instead of implicitly converting it to a string for the updated release body. --- src/github.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/github.ts b/src/github.ts index 2613d4c32..22f6e07dc 100644 --- a/src/github.ts +++ b/src/github.ts @@ -181,7 +181,11 @@ export const release = async ( } const tag_name = tag; const name = config.input_name || tag; - const body = `${existingRelease.data.body}\n${releaseBody(config)}`; + let body: string = ""; + if (existingRelease.data.body != null) { + body += `${existingRelease.data.body}\n`; + } + body += releaseBody(config); const draft = config.input_draft; const prerelease = config.input_prerelease;