refactor: move validateExclusiveModes before getBody in run()

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-13 12:00:42 +00:00
parent bab09a2bad
commit 2cdb9b3380

View file

@ -36,14 +36,6 @@ async function run(): Promise<undefined> {
}
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<undefined> {
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)