Skip to content

Commit

Permalink
feat: support console skip
Browse files Browse the repository at this point in the history
  • Loading branch information
xrkffgg committed Jan 15, 2024
1 parent c7beafe commit 3112326
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 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
11 changes: 6 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,18 @@ 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
11 changes: 6 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,18 @@ 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 3112326

Please sign in to comment.