mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-05-06 03:54:44 +00:00
refactor: move validateExclusiveModes before getBody in run()
Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>
This commit is contained in:
parent
bab09a2bad
commit
2cdb9b3380
1 changed files with 9 additions and 8 deletions
17
src/main.ts
17
src/main.ts
|
|
@ -36,14 +36,6 @@ async function run(): Promise<undefined> {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const body = await getBody()
|
|
||||||
|
|
||||||
if (!body && ignoreEmpty) {
|
|
||||||
core.info("no body given: skip step by ignoreEmpty")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
validateBody(body, deleteOldComment, hideOldComment)
|
|
||||||
validateExclusiveModes(
|
validateExclusiveModes(
|
||||||
deleteOldComment,
|
deleteOldComment,
|
||||||
recreate,
|
recreate,
|
||||||
|
|
@ -53,6 +45,15 @@ async function run(): Promise<undefined> {
|
||||||
hideAndRecreate,
|
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 octokit = github.getOctokit(githubToken)
|
||||||
const previous = await findPreviousComment(octokit, repo, pullRequestNumber, header)
|
const previous = await findPreviousComment(octokit, repo, pullRequestNumber, header)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue