Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support console skip #4

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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