From 89b7b228223caa15a05a3d7e3ff4ce5d22fdf39e Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Tue, 30 Aug 2022 19:19:36 +0800 Subject: [PATCH] fix: remove commit pending. (#3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 元凛 --- CHANGELOG.md | 6 ++++++ dist/index.js | 11 ++++------- src/main.js | 5 +---- src/octokit.js | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc06e0..c43b365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.4.1 + +`2022.08.30` + +- fix: remove commit pending. + ## v1.4.0 `2021.10.19` diff --git a/dist/index.js b/dist/index.js index 2067d2c..a47d4a7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9804,10 +9804,7 @@ async function run() { let number = filterPRs[i]; const result = await getPRStatus(owner, repo, number); if (result.ifCICompleted) { - if ( - (result.commitState === 'success' || result.commitState === 'pending') && - !result.ifCIHasFailure - ) { + if (result.commitState === 'success' && !result.ifCIHasFailure) { const onePR = await getOnePR(owner, repo, number); if (onePR.mergeable_state === 'dirty') { await doPRReview(owner, repo, number, 'REQUEST_CHANGES', conflictReviewBody); @@ -9930,18 +9927,18 @@ async function getPRStatus(owner, repo, number) { if (!dealStringToArr(skipRunNames).includes(it.name)) { ifCICompleted = false; } - core.info(`[checkPRstatus][number: ${number}][inPorgress: ${it.name}]`); + core.info(`[checkPRstatus] [number: ${number}] [inPorgress: ${it.name}]`); } if (it.conclusion === 'failure') { if (!dealStringToArr(skipRunNames).includes(it.name)) { ifCIHasFailure = true; } - core.info(`[checkPRstatus][number: ${number}][hasFailure: ${it.name}]`); + core.info(`[checkPRstatus] [number: ${number}] [hasFailure: ${it.name}]`); } }); core.info( - `[getPRStatus][number: ${number}/${runs.length}][commit: ${commit}][commitState: ${commitState}][ifCICompleted: ${ifCICompleted}][ifCIHasFailure: ${ifCIHasFailure}]`, + `[getPRStatus] [number: ${number}] [CI: ${runs.length}] [commit: ${commit}]\n\n[commitState: ${commitState}] [ifCICompleted: ${ifCICompleted}] [ifCIHasFailure: ${ifCIHasFailure}]`, ); return { diff --git a/src/main.js b/src/main.js index 59142a5..88c78e7 100644 --- a/src/main.js +++ b/src/main.js @@ -100,10 +100,7 @@ async function run() { let number = filterPRs[i]; const result = await getPRStatus(owner, repo, number); if (result.ifCICompleted) { - if ( - (result.commitState === 'success' || result.commitState === 'pending') && - !result.ifCIHasFailure - ) { + if (result.commitState === 'success' && !result.ifCIHasFailure) { const onePR = await getOnePR(owner, repo, number); if (onePR.mergeable_state === 'dirty') { await doPRReview(owner, repo, number, 'REQUEST_CHANGES', conflictReviewBody); diff --git a/src/octokit.js b/src/octokit.js index b94e976..57c6bb0 100644 --- a/src/octokit.js +++ b/src/octokit.js @@ -81,18 +81,18 @@ async function getPRStatus(owner, repo, number) { if (!dealStringToArr(skipRunNames).includes(it.name)) { ifCICompleted = false; } - core.info(`[checkPRstatus][number: ${number}][inPorgress: ${it.name}]`); + core.info(`[checkPRstatus] [number: ${number}] [inPorgress: ${it.name}]`); } if (it.conclusion === 'failure') { if (!dealStringToArr(skipRunNames).includes(it.name)) { ifCIHasFailure = true; } - core.info(`[checkPRstatus][number: ${number}][hasFailure: ${it.name}]`); + core.info(`[checkPRstatus] [number: ${number}] [hasFailure: ${it.name}]`); } }); core.info( - `[getPRStatus][number: ${number}/${runs.length}][commit: ${commit}][commitState: ${commitState}][ifCICompleted: ${ifCICompleted}][ifCIHasFailure: ${ifCIHasFailure}]`, + `[getPRStatus] [number: ${number}] [CI: ${runs.length}] [commit: ${commit}]\n\n[commitState: ${commitState}] [ifCICompleted: ${ifCICompleted}] [ifCIHasFailure: ${ifCIHasFailure}]`, ); return {