Don't make api call when body is empty

This commit is contained in:
Sebass van Boxel 2020-11-04 22:20:58 +01:00
parent 1c0044770b
commit 2350aa6ad6
No known key found for this signature in database
GPG key ID: A1E93D1FBDF515B7
2 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ export async function findPreviousComment(octokit, repo, issue_number, header) {
return comments.find(comment => comment.body.includes(h));
}
export async function updateComment(octokit, repo, comment_id, body, header, previousBody?) {
if (!body && !previousBody) core.warning('Comment body cannot be blank');
if (!body && !previousBody) return core.warning('Comment body cannot be blank');
await octokit.issues.updateComment({
...repo,
@ -22,7 +22,7 @@ export async function updateComment(octokit, repo, comment_id, body, header, pre
});
}
export async function createComment(octokit, repo, issue_number, body, header, previousBody?) {
if (!body) core.warning('Comment body cannot be blank');
if (!body && !previousBody) return core.warning('Comment body cannot be blank');
await octokit.issues.createComment({
...repo,