Skip to content

Commit

Permalink
Update dist/index.js and docs after PR #50
Browse files Browse the repository at this point in the history
  • Loading branch information
dorny committed Nov 13, 2020
1 parent dec8b80 commit eb8fe2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v2.5.3
- [Fixed retrieval of all changes via Github API when there are 100+ changes](https://github.com/dorny/paths-filter/pull/50)

## v2.5.2
- [Add support for multiple patterns when using file status](https://github.com/dorny/paths-filter/pull/48)
- [Use picomatch directly instead of micromatch wrapper](https://github.com/dorny/paths-filter/pull/49)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ For more scenarios see [examples](#examples) section.


# What's New
- Fixed retrieval of all changes via Github API when there are 100+ changes
- Paths expressions are now evaluated using [picomatch](https://github.com/micromatch/picomatch) library
- Support workflows triggered by any event
- Fixed compatibility with older (<2.23) versions of git
Expand Down
10 changes: 7 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit eb8fe2c

Please sign in to comment.