Skip to content

Commit a255509

Browse files
authored
Filter PRs by label ('Module: PrivateUse1') (#52)
1 parent e4fcfc0 commit a255509

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ runs:
6868
if (prs.length > 0) {
6969
const pr_urls = prs.map(pr => pr.html_url);
7070
core.info(`prs: ${pr_urls.join("\n")}`);
71+
} else {
72+
core.warning("No pull requests found!");
7173
}
7274
7375
const result = prs.map(pr => ({

.github/workflows/dispatch-event.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,32 @@ on:
44
schedule:
55
- cron: '0 12 * * *'
66

7+
pull_request:
8+
branches:
9+
- 'main'
10+
paths:
11+
- '.github/workflows/dispatch-event.yml'
12+
- '.github/workflows/redispatch-event.yml'
13+
- '.github/actions/list-pr/**'
14+
- '!**/*.md'
15+
716
workflow_dispatch:
817
inputs:
918
labels:
1019
required: false
1120
type: string
12-
default: ''
21+
default: 'module: PrivateUse1'
1322
description: 'The labels on pull requests'
1423
hours:
1524
required: false
1625
type: number
1726
default: 24
1827
description: 'Pull requests created within this many hours will be listed'
28+
limit:
29+
required: false
30+
type: number
31+
default: -1
32+
description: 'How many pull requests will be listed'
1933

2034
concurrency:
2135
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
@@ -39,10 +53,11 @@ jobs:
3953
token: ${{ secrets.COSDT_BOT_TOKEN }}
4054
owner: pytorch
4155
repository: pytorch
42-
labels: ${{ github.event.inputs.labels || '' }}
56+
labels: "${{ github.event.inputs.labels || 'module: PrivateUse1' }}"
4357
hours: ${{ github.event.inputs.hours || '24' }}
4458

4559
dispatch-pr:
60+
if: ${{ needs.list-pr.outputs.prs != '[]' }}
4661
name: 'Dispatch PR event - #${{ matrix.data.pull_request.number }}'
4762
runs-on: ubuntu-latest
4863
needs:

0 commit comments

Comments
 (0)