build: fix docs only change script to pull all files not just 30 (#28737)
This commit is contained in:
parent
e12a3cb59c
commit
4f3664e6d9
1 changed files with 9 additions and 6 deletions
|
@ -27,19 +27,22 @@ async function checkIfDocOnlyChange () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const filesChanged = await octokit.pulls.listFiles({
|
const filesChanged = await octokit.paginate(octokit.pulls.listFiles.endpoint.merge({
|
||||||
owner: 'electron', repo: 'electron', pull_number: pullRequestNumber
|
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('/');
|
const fileDirs = fileInfo.filename.split('/');
|
||||||
if (fileDirs[0] !== 'docs') {
|
if (fileDirs[0] !== 'docs') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (nonDocChange || filesChanged.data.length === 0) {
|
if (nonDocChange || filesChanged.length === 0) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue