Add ignore empty input

This commit is contained in:
Sam 2022-10-25 21:49:30 +00:00
parent 1d46172340
commit db01d1ad6c
6 changed files with 78 additions and 20 deletions

View file

@ -12,7 +12,8 @@ import {
hideOldComment,
pullRequestNumber,
recreate,
repo
repo,
ignoreEmpty
} from "./config"
import {
createComment,
@ -32,6 +33,10 @@ async function run(): Promise<undefined> {
try {
const body = await getBody()
if (!body && ignoreEmpty) {
return
}
if (!deleteOldComment && !hideOldComment && !body) {
throw new Error("Either message or path input is required")
}