mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
Update dist/index.js and docs after PR #50
This commit is contained in:
parent
dec8b8030e
commit
eb8fe2c24b
3 changed files with 11 additions and 3 deletions
10
dist/index.js
vendored
10
dist/index.js
vendored
|
@ -4729,12 +4729,15 @@ async function getChangedFilesFromGit(base, initialFetchDepth) {
|
|||
}
|
||||
// Uses github REST api to get list of files changed in PR
|
||||
async function getChangedFilesFromApi(token, pullRequest) {
|
||||
var _a;
|
||||
core.info(`Fetching list of changed files for PR#${pullRequest.number} from Github API`);
|
||||
const client = new github.GitHub(token);
|
||||
const pageSize = 100;
|
||||
const files = [];
|
||||
for (let page = 0; page * pageSize < pullRequest.changed_files; page++) {
|
||||
const response = await client.pulls.listFiles({
|
||||
let response;
|
||||
let page = 0;
|
||||
do {
|
||||
response = await client.pulls.listFiles({
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
pull_number: pullRequest.number,
|
||||
|
@ -4763,7 +4766,8 @@ async function getChangedFilesFromApi(token, pullRequest) {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
page++;
|
||||
} while (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.length) > 0);
|
||||
return files;
|
||||
}
|
||||
function exportResults(results, format) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue