Skip to content

Commit

Permalink
build: fix docs only change script to pull all files not just 30
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Apr 18, 2021
1 parent 384966e commit be65e65
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions script/doc-only-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@ async function checkIfDocOnlyChange () {
}
}
}
const filesChanged = await octokit.pulls.listFiles({
owner: 'electron', repo: 'electron', pull_number: pullRequestNumber
});
const filesChanged = await octokit.paginate(octokit.pulls.listFiles.endpoint.merge({
owner: 'electron',
repo: 'electron',
pull_number: pullRequestNumber,
per_page: 100
}));

console.log('Changed Files:', filesChanged.data.map(fileInfo => fileInfo.filename));
console.log('Changed Files:', filesChanged.map(fileInfo => fileInfo.filename));

const nonDocChange = filesChanged.data.find((fileInfo) => {
const nonDocChange = filesChanged.find((fileInfo) => {
const fileDirs = fileInfo.filename.split('/');
if (fileDirs[0] !== 'docs') {
return true;
}
});
if (nonDocChange || filesChanged.data.length === 0) {
if (nonDocChange || filesChanged.length === 0) {
process.exit(1);
} else {
process.exit(0);
Expand Down

0 comments on commit be65e65

Please sign in to comment.