Skip to content

Commit

Permalink
feat: support console skip (#4)
Browse files Browse the repository at this point in the history
* feat: support console skip

* fix: lint

* fix: build
  • Loading branch information
xrkffgg authored Jan 15, 2024
1 parent c7beafe commit 7522642
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 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.5.0

`2024.01.15`

- feat: support console skip.

## v1.4.1

`2022.08.30`
Expand Down
15 changes: 10 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9900,7 +9900,7 @@ async function checkAuthority(owner, repo, username, filterCreatorAuthority) {
}

async function getPRStatus(owner, repo, number) {
const skipRunNames = core.getInput('skip-run-names');
const skipRunNames = dealStringToArr(core.getInput('skip-run-names'));
const { data: pr } = await octokit.pulls.get({
owner,
repo,
Expand All @@ -9923,17 +9923,22 @@ async function getPRStatus(owner, repo, number) {
let ifCICompleted = true;
let ifCIHasFailure = false;
runs.forEach(it => {
const isSkip = skipRunNames.includes(it.name);
if (it.status == 'in_progress') {
if (!dealStringToArr(skipRunNames).includes(it.name)) {
if (!isSkip) {
ifCICompleted = false;
}
core.info(`[checkPRstatus] [number: ${number}] [inPorgress: ${it.name}]`);
core.info(
`[checkPRstatus] [number: ${number}] [inPorgress: ${it.name}]${isSkip ? ' 🛎 SKIP' : ''}`,
);
}
if (it.conclusion === 'failure') {
if (!dealStringToArr(skipRunNames).includes(it.name)) {
if (!isSkip) {
ifCIHasFailure = true;
}
core.info(`[checkPRstatus] [number: ${number}] [hasFailure: ${it.name}]`);
core.info(
`[checkPRstatus] [number: ${number}] [hasFailure: ${it.name}]${isSkip ? ' 🛎 SKIP' : ''}`,
);
}
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"@umijs/fabric": "^2.5.6",
"@vercel/ncc": "^0.27.0",
"@vercel/ncc": "0.34.0",
"prettier": "^2.2.1"
}
}
15 changes: 10 additions & 5 deletions src/octokit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function checkAuthority(owner, repo, username, filterCreatorAuthority) {
}

async function getPRStatus(owner, repo, number) {
const skipRunNames = core.getInput('skip-run-names');
const skipRunNames = dealStringToArr(core.getInput('skip-run-names'));
const { data: pr } = await octokit.pulls.get({
owner,
repo,
Expand All @@ -77,17 +77,22 @@ async function getPRStatus(owner, repo, number) {
let ifCICompleted = true;
let ifCIHasFailure = false;
runs.forEach(it => {
const isSkip = skipRunNames.includes(it.name);
if (it.status == 'in_progress') {
if (!dealStringToArr(skipRunNames).includes(it.name)) {
if (!isSkip) {
ifCICompleted = false;
}
core.info(`[checkPRstatus] [number: ${number}] [inPorgress: ${it.name}]`);
core.info(
`[checkPRstatus] [number: ${number}] [inPorgress: ${it.name}]${isSkip ? ' 🛎 SKIP' : ''}`,
);
}
if (it.conclusion === 'failure') {
if (!dealStringToArr(skipRunNames).includes(it.name)) {
if (!isSkip) {
ifCIHasFailure = true;
}
core.info(`[checkPRstatus] [number: ${number}] [hasFailure: ${it.name}]`);
core.info(
`[checkPRstatus] [number: ${number}] [hasFailure: ${it.name}]${isSkip ? ' 🛎 SKIP' : ''}`,
);
}
});

Expand Down

0 comments on commit 7522642

Please sign in to comment.