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.
This commit is contained in:
Darragh Bailey 2021-05-13 17:18:19 +01:00
parent 9729932bfb
commit 175b44e02b

View file

@ -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;