diff --git a/.github/actions/list-pr/action.yml b/.github/actions/list-pr/action.yml index 652f9c6..7a5e98b 100644 --- a/.github/actions/list-pr/action.yml +++ b/.github/actions/list-pr/action.yml @@ -68,6 +68,8 @@ runs: if (prs.length > 0) { const pr_urls = prs.map(pr => pr.html_url); core.info(`prs: ${pr_urls.join("\n")}`); + } else { + core.warning("No pull requests found!"); } const result = prs.map(pr => ({ diff --git a/.github/workflows/dispatch-event.yml b/.github/workflows/dispatch-event.yml index 3722746..d38d668 100644 --- a/.github/workflows/dispatch-event.yml +++ b/.github/workflows/dispatch-event.yml @@ -4,18 +4,32 @@ on: schedule: - cron: '0 12 * * *' + pull_request: + branches: + - 'main' + paths: + - '.github/workflows/dispatch-event.yml' + - '.github/workflows/redispatch-event.yml' + - '.github/actions/list-pr/**' + - '!**/*.md' + workflow_dispatch: inputs: labels: required: false type: string - default: '' + default: 'module: PrivateUse1' description: 'The labels on pull requests' hours: required: false type: number default: 24 description: 'Pull requests created within this many hours will be listed' + limit: + required: false + type: number + default: -1 + description: 'How many pull requests will be listed' concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} @@ -39,10 +53,11 @@ jobs: token: ${{ secrets.COSDT_BOT_TOKEN }} owner: pytorch repository: pytorch - labels: ${{ github.event.inputs.labels || '' }} + labels: "${{ github.event.inputs.labels || 'module: PrivateUse1' }}" hours: ${{ github.event.inputs.hours || '24' }} dispatch-pr: + if: ${{ needs.list-pr.outputs.prs != '[]' }} name: 'Dispatch PR event - #${{ matrix.data.pull_request.number }}' runs-on: ubuntu-latest needs: