Skip to content

Commit dcf4342

Browse files
committed
update
1 parent ea65774 commit dcf4342

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/actions/list-pr/action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ runs:
3535
result-encoding: string
3636
debug: true
3737
script: |
38-
const pullsResp = await github.paginate(github.rest.pulls.list, {
38+
const timeRange = parseInt("24") * 60 * 60 * 1000;
39+
const sinceTime = new Date(Date.now() - timeRange).toISOString();
40+
const input_labels = "";
41+
const labels = input_labels
42+
? input_labels.split(/[,\n]/).map(label => label.trim())
43+
: [];
44+
45+
const iterator = await github.paginate.iterator(github.rest.pulls.list, {
3946
owner: "pytorch",
4047
repo: "pytorch",
4148
state: "open",
@@ -44,15 +51,8 @@ runs:
4451
per_page: 100,
4552
});
4653
47-
const timeRange = parseInt("24") * 60 * 60 * 1000;
48-
const sinceTime = new Date(Date.now() - timeRange).toISOString();
49-
const input_labels = "";
50-
const labels = input_labels
51-
? input_labels.split(/[,\n]/).map(label => label.trim())
52-
: [];
53-
5454
const prs = [];
55-
for await (const resp of pullsResp) {
55+
for await (const resp of iterator) {
5656
const filtered_prs = resp.data.filter(pr => {
5757
const hasLabel = labels.length === 0
5858
|| labels.every(label => pr.labels.some(prLabel => prLabel.name === label));

0 commit comments

Comments
 (0)