Skip to content

Commit

Permalink
fix: skip-run-names use check
Browse files Browse the repository at this point in the history
  • Loading branch information
xrkffgg committed Feb 24, 2021
1 parent 00325f6 commit 62a2dbe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 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.2.2

`2021.02.24`

- fix: `skip-run-names` use check.

## v1.2.1

`2021.02.24`
Expand Down
10 changes: 7 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}]`);
}
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 7 additions & 3 deletions src/octokit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}]`);
}
});
Expand Down

0 comments on commit 62a2dbe

Please sign in to comment.