mirror of
https://github.com/SethCohen/github-releases-to-discord
synced 2026-09-14 20:13:23 +00:00
feat(tests): add test for handling release payload with null body and update formatDescription to handle undefined input. resolves #53
This commit is contained in:
@@ -110,7 +110,7 @@ const convertLinksToMarkdown = (text) => {
|
||||
* @returns {string} The formatted description.
|
||||
*/
|
||||
const formatDescription = (description) => {
|
||||
let edit = removeCarriageReturn(description);
|
||||
let edit = removeCarriageReturn(description ?? '');
|
||||
edit = removeHTMLComments(edit);
|
||||
edit = reduceNewlines(edit);
|
||||
|
||||
@@ -303,8 +303,8 @@ const run = async () => {
|
||||
|
||||
const { body, html_url, name } = getContext();
|
||||
|
||||
if (!body || !name) {
|
||||
return core.setFailed('No GitHub release payload found. When using workflow_dispatch, pass release_name and release_body inputs to the action.');
|
||||
if (!name) {
|
||||
return core.setFailed('No GitHub release payload found. When using workflow_dispatch, pass release_name to the action.');
|
||||
}
|
||||
|
||||
const description = formatDescription(body);
|
||||
|
||||
Reference in New Issue
Block a user