diff --git a/src/main.ts b/src/main.ts index 5a83f81..65b165e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -36,14 +36,6 @@ async function run(): Promise { } try { - const body = await getBody() - - if (!body && ignoreEmpty) { - core.info("no body given: skip step by ignoreEmpty") - return - } - - validateBody(body, deleteOldComment, hideOldComment) validateExclusiveModes( deleteOldComment, recreate, @@ -53,6 +45,15 @@ async function run(): Promise { hideAndRecreate, ) + const body = await getBody() + + if (!body && ignoreEmpty) { + core.info("no body given: skip step by ignoreEmpty") + return + } + + validateBody(body, deleteOldComment, hideOldComment) + const octokit = github.getOctokit(githubToken) const previous = await findPreviousComment(octokit, repo, pullRequestNumber, header)