From 62a2dbe3878c79ccc24083c49abbc266c03205bf Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Wed, 24 Feb 2021 21:13:15 +0800 Subject: [PATCH] fix: skip-run-names use check --- CHANGELOG.md | 6 ++++++ dist/index.js | 10 +++++++--- package.json | 2 +- src/octokit.js | 10 +++++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aac010d..15f9889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.2.2 + +`2021.02.24` + +- fix: `skip-run-names` use check. + ## v1.2.1 `2021.02.24` diff --git a/dist/index.js b/dist/index.js index 9c1f936..d2e7d10 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6165,11 +6165,15 @@ async function getPRStatus(owner, repo, number) { let ifCIHasFailure = false; runs.forEach(it => { if (it.status == 'in_progress') { - ifCICompleted = false; + if (!dealStringToArr(skipRunNames).includes(it.name)) { + ifCICompleted = false; + } core.info(`[checkPRstatus][number: ${number}][inPorgress: ${it.name}]`); } - if (it.conclusion === 'failure' && !dealStringToArr(skipRunNames).includes(it.name)) { - ifCIHasFailure = true; + if (it.conclusion === 'failure') { + if (!dealStringToArr(skipRunNames).includes(it.name)) { + ifCIHasFailure = true; + } core.info(`[checkPRstatus][number: ${number}][hasFailure: ${it.name}]`); } }); diff --git a/package.json b/package.json index 92ff451..bd6fa4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "check-pr-ci", - "version": "1.2.0", + "version": "1.2.2", "private": true, "description": "Check the PR CI status and perform some operation after success or failure.", "main": "src/main.js", diff --git a/src/octokit.js b/src/octokit.js index eeb5d9b..b94e976 100644 --- a/src/octokit.js +++ b/src/octokit.js @@ -78,11 +78,15 @@ async function getPRStatus(owner, repo, number) { let ifCIHasFailure = false; runs.forEach(it => { if (it.status == 'in_progress') { - ifCICompleted = false; + if (!dealStringToArr(skipRunNames).includes(it.name)) { + ifCICompleted = false; + } core.info(`[checkPRstatus][number: ${number}][inPorgress: ${it.name}]`); } - if (it.conclusion === 'failure' && !dealStringToArr(skipRunNames).includes(it.name)) { - ifCIHasFailure = true; + if (it.conclusion === 'failure') { + if (!dealStringToArr(skipRunNames).includes(it.name)) { + ifCIHasFailure = true; + } core.info(`[checkPRstatus][number: ${number}][hasFailure: ${it.name}]`); } });