Skip to content

Commit

Permalink
Merge pull request #2 from trilom/releases/v1
Browse files Browse the repository at this point in the history
Releases/v1.1
  • Loading branch information
trilom authored Jan 21, 2020
2 parents 2aa5b11 + 58a058a commit c15d152
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1739,12 +1739,14 @@ function sortChangedFiles(files) {
}
function getChangedPRFiles(client, prNumber) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield client.pulls.listFiles({
const options = client.pulls.listFiles.endpoint.merge({
owner: gh.context.repo.owner,
repo: gh.context.repo.repo,
pull_number: prNumber
});
return sortChangedFiles(response.data);
return sortChangedFiles(yield client.paginate(options).then(files => {
return files;
}));
});
}
function getChangedPushFiles(client, base, head) {
Expand Down
6 changes: 4 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ function sortChangedFiles(files) {
}
function getChangedPRFiles(client, prNumber) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield client.pulls.listFiles({
const options = client.pulls.listFiles.endpoint.merge({
owner: gh.context.repo.owner,
repo: gh.context.repo.repo,
pull_number: prNumber
});
return sortChangedFiles(response.data);
return sortChangedFiles(yield client.paginate(options).then(files => {
return files;
}));
});
}
function getChangedPushFiles(client, base, head) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "file-changes-action",
"version": "1.0.0",
"version": "1.1.0",
"description": "Creates outputs variables of files modified, added, or deleted by a PR or Push.",
"main": "lib/main.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ async function getChangedPRFiles(
client: gh.GitHub,
prNumber: number
): Promise<ChangedFiles> {
const response = await client.pulls.listFiles({
const options = client.pulls.listFiles.endpoint.merge({
owner: gh.context.repo.owner,
repo: gh.context.repo.repo,
pull_number: prNumber
})
return sortChangedFiles(response.data)
return sortChangedFiles(
await client.paginate(options).then(files => {
return files
})
)
}

async function getChangedPushFiles(
Expand Down

0 comments on commit c15d152

Please sign in to comment.