Skip to content

Commit 342ff5b

Browse files
authored
fix(git-node): ignore all non-gha nodes when checking for GitHub CI (#857)
1 parent 9224469 commit 342ff5b

10 files changed

+13
-4
lines changed

lib/pr_checker.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const GITHUB_SUCCESS_CONCLUSIONS = ['SUCCESS', 'NEUTRAL', 'SKIPPED'];
2929
const FAST_TRACK_RE = /^Fast-track has been requested by @(.+?)\. Please 👍 to approve\.$/;
3030
const FAST_TRACK_MIN_APPROVALS = 2;
3131
const GIT_CONFIG_GUIDE_URL = 'https://github.com/nodejs/node/blob/99b1ada/doc/guides/contributing/pull-requests.md#step-1-fork';
32-
const IGNORED_CHECK_SLUGS = ['dependabot', 'codecov'];
3332

3433
// eslint-disable-next-line no-extend-native
3534
Array.prototype.findLastIndex ??= function findLastIndex(fn) {
@@ -374,9 +373,10 @@ export default class PRChecker {
374373

375374
// GitHub new Check API
376375
for (const { status, conclusion, app } of checkSuites.nodes) {
377-
if (app && IGNORED_CHECK_SLUGS.includes(app.slug)) {
378-
// Ignore Dependabot and Codecov check suites.
379-
// They are expected to show up sometimes and never complete.
376+
if (app.slug !== 'github-actions') {
377+
// Ignore all non-github check suites, such as Dependabot and Codecov.
378+
// They are expected to show up on PRs whose head branch is not on a
379+
// fork and never complete.
380380
continue;
381381
}
382382

test/fixtures/github-ci/both-apis-failure.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"checkSuites": {
1414
"nodes": [
1515
{
16+
"app": { "slug": "github-actions" },
1617
"status": "COMPLETED",
1718
"conclusion": "FAILURE"
1819
}

test/fixtures/github-ci/both-apis-success.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"checkSuites": {
1414
"nodes": [
1515
{
16+
"app": { "slug": "github-actions" },
1617
"status": "COMPLETED",
1718
"conclusion": "SUCCESS"
1819
}

test/fixtures/github-ci/check-suite-failure.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"checkSuites": {
1111
"nodes": [
1212
{
13+
"app": { "slug": "github-actions" },
1314
"status": "COMPLETED",
1415
"conclusion": "FAILURE"
1516
}

test/fixtures/github-ci/check-suite-pending.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"checkSuites": {
1111
"nodes": [
1212
{
13+
"app": { "slug": "github-actions" },
1314
"status": "IN_PROGRESS"
1415
}
1516
]

test/fixtures/github-ci/check-suite-skipped.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"checkSuites": {
1111
"nodes": [
1212
{
13+
"app": { "slug": "github-actions" },
1314
"status": "COMPLETED",
1415
"conclusion": "SKIPPED"
1516
}

test/fixtures/github-ci/check-suite-success.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"checkSuites": {
1111
"nodes": [
1212
{
13+
"app": { "slug": "github-actions" },
1314
"status": "COMPLETED",
1415
"conclusion": "SUCCESS"
1516
}

test/fixtures/github-ci/status-failure-check-suite-succeed.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"checkSuites": {
1414
"nodes": [
1515
{
16+
"app": { "slug": "github-actions" },
1617
"status": "COMPLETED",
1718
"conclusion": "SUCCESS"
1819
}

test/fixtures/github-ci/status-succeed-check-suite-failure.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"checkSuites": {
1414
"nodes": [
1515
{
16+
"app": { "slug": "github-actions" },
1617
"status": "COMPLETED",
1718
"conclusion": "FAILURE"
1819
}

test/fixtures/github-ci/success-dependabot-queued.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"conclusion": null
1818
},
1919
{
20+
"app": { "slug": "github-actions" },
2021
"status": "COMPLETED",
2122
"conclusion": "SUCCESS"
2223
}

0 commit comments

Comments
 (0)