Skip to content

Commit

Permalink
fix: remove commit pending. (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: 元凛 <[email protected]>
  • Loading branch information
xrkffgg and 元凛 authored Aug 30, 2022
1 parent 04242aa commit 89b7b22
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.4.1

`2022.08.30`

- fix: remove commit pending.

## v1.4.0

`2021.10.19`
Expand Down
11 changes: 4 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 1 addition & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/octokit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 89b7b22

Please sign in to comment.