Skip to content

Commit

Permalink
fix: Body cannot be blank
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Sep 17, 2020
1 parent ba5a88b commit 4d1b383
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion actions/src/suggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@ export async function suggest(inps: Inputs): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const body = `${(context.payload.issue as any).body}`;
const githubAPI = new GitHubAPI(inps.GithubToken, context.repo.owner, context.repo.repo);
await githubAPI.createComment(removeSymbols(md2text(body)));
const suggestBody = (() => {
if (body === '') {
return 'context body is empty';
} else {
return removeSymbols(md2text(body));
}
})();
await githubAPI.createComment(suggestBody);
}

0 comments on commit 4d1b383

Please sign in to comment.