mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
build: fix docs only change script to pull all files not just 30 (#28743)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
@@ -30,19 +30,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);
|
||||
|
||||
Reference in New Issue
Block a user