Skip to content

Commit e0d69eb

Browse files
committed
update
1 parent 89ad734 commit e0d69eb

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,45 +35,45 @@ runs:
3535
result-encoding: string
3636
script: |
3737
const resp = await github.rest.pulls.list({
38-
owner: ${{ inputs.owner }},
39-
repo: ${{ inputs.repository }},
40-
state: 'open',
41-
sort: 'created',
42-
per_page: 100
38+
owner: "pytorch",
39+
repo: "pytorch",
40+
state: "open",
41+
sort: "created",
42+
per_page: 100,
4343
});
4444
45-
const timeRange = parseInt(${{ inputs.hours }}) * 60 * 60 * 1000;
45+
const timeRange = parseInt("24") * 60 * 60 * 1000;
4646
const sinceTime = new Date(Date.now() - timeRange).toISOString();
47-
const input_labels = ${{ inputs.labels }};
47+
const input_labels = "";
4848
const labels = input_labels
49-
? input_labels.split(/,|\n/).map(label => label.trim())
50-
: [];
49+
? input_labels.split(/[,\n]/).map(label => label.trim())
50+
: [];
5151
5252
const prs = resp.data.filter(pr => {
53-
const hasLabel = labels.length === 0
54-
|| labels.every(label => pr.labels.some(prLabel => prLabel.name === label));
53+
const hasLabel = labels.length === 0
54+
|| labels.every(label => pr.labels.some(prLabel => prLabel.name === label));
5555
56-
const createdAt = new Date(pr.created_at);
57-
const isWithinTimeRange = createdAt >= new Date(sinceTime);
56+
const createdAt = new Date(pr.created_at);
57+
const isWithinTimeRange = createdAt >= new Date(sinceTime);
5858
59-
return hasLabel && isWithinTimeRange;
59+
return hasLabel && isWithinTimeRange;
6060
});
6161
6262
const pr_urls = prs.map(pr => pr.html_url);
6363
core.info(`prs: ${pr_urls.join(",\n")}`);
6464
6565
return prs.map(pr => ({
66-
number: pr.number,
67-
title: pr.title,
68-
body: pr.body,
69-
state: pr.state,
70-
draft: pr.draft,
71-
created_at: pr.created_at,
72-
updated_at: pr.updated_at,
73-
closed_at: pr.closed_at,
74-
merged_at: pr.merged_at,
75-
html_url: pr.html_url,
76-
base: pr.base.ref,
77-
head: pr.head.ref,
78-
labels: pr.labels.map(label => label.name)
66+
number: pr.number,
67+
title: pr.title,
68+
body: pr.body,
69+
state: pr.state,
70+
draft: pr.draft,
71+
created_at: pr.created_at,
72+
updated_at: pr.updated_at,
73+
closed_at: pr.closed_at,
74+
merged_at: pr.merged_at,
75+
html_url: pr.html_url,
76+
base: pr.base.ref,
77+
head: pr.head.ref,
78+
labels: pr.labels.map(label => label.name),
7979
}));

0 commit comments

Comments
 (0)