Skip to content

Commit

Permalink
feat: ignore .md files when do requiresJenkinsRun check
Browse files Browse the repository at this point in the history
  • Loading branch information
F3n67u committed Jul 12, 2022
1 parent 460b50d commit f034f8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/pr_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ export default class PRChecker {
return false;
}

const files = pr.files.nodes;

// Don't require Jenkins run if pr is doc-only changes
const isDocOnlyChange = files.every(({ path }) => path.endsWith('.md'));
if (isDocOnlyChange) {
return false;
}

const ciNeededFolderRx = /^(deps|lib|src|test)\//;
const ciNeededToolFolderRx =
/^tools\/(code_cache|gyp|icu|inspector|msvs|snapshot|v8_gypfiles)/;
Expand All @@ -416,7 +424,7 @@ export default class PRChecker {
];
const ciNeededExtensionList = ['.gyp', '.gypi', '.bat'];

return pr.files.nodes.some(
return files.some(
({ path }) =>
ciNeededFolderRx.test(path) ||
ciNeededToolFolderRx.test(path) ||
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/pull_requests/doc-only.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
},
{
"path": "doc/api/package_json.md"
},
{
"path": "tools/icu/README.md"
},
{
"path": "deps/ngtcp2/README.md"
}
]
},
Expand Down

0 comments on commit f034f8c

Please sign in to comment.