diff --git a/.github/actions/list-pr/action.yml b/.github/actions/list-pr/action.yml index a3fe0c5..652f9c6 100644 --- a/.github/actions/list-pr/action.yml +++ b/.github/actions/list-pr/action.yml @@ -1,4 +1,4 @@ -name: 'List Pull Requests' +name: 'List pull requests' description: 'list and put output pull requests' inputs: owner: @@ -34,16 +34,16 @@ runs: github-token: ${{ inputs.token }} result-encoding: string script: | - const timeRange = parseInt("24") * 60 * 60 * 1000; + const timeRange = parseInt("${{ inputs.hours }}") * 60 * 60 * 1000; const sinceTime = new Date(Date.now() - timeRange).toISOString(); - const input_labels = ""; + const input_labels = "${{ inputs.labels }}"; const labels = input_labels ? input_labels.split(/[,\n]/).map(label => label.trim()) : []; const iterator = await github.paginate.iterator(github.rest.pulls.list, { - owner: "pytorch", - repo: "pytorch", + owner: "${{ inputs.owner }}", + repo: "${{ inputs.repository }}", state: "open", sort: "created", direction: "desc", diff --git a/.github/workflows/ascend_npu_test.yml b/.github/workflows/ascend_npu_test.yml index 7721896..658f695 100644 --- a/.github/workflows/ascend_npu_test.yml +++ b/.github/workflows/ascend_npu_test.yml @@ -71,7 +71,7 @@ on: # Only cancel the previous runs when triggered by a pull_request event concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + group: ${{ github.workflow }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: @@ -83,6 +83,7 @@ jobs: image: ${{ steps.set-env.outputs.image }} device: ${{ steps.set-env.outputs.device }} ref: ${{ steps.list-ref.outputs.ref }} + pr-number: ${{ steps.list-ref.outputs.pr_number }} steps: - name: Set environment params id: set-env diff --git a/.github/workflows/dispatch-event.yml b/.github/workflows/dispatch-event.yml index 323babd..413cdf5 100644 --- a/.github/workflows/dispatch-event.yml +++ b/.github/workflows/dispatch-event.yml @@ -1,6 +1,14 @@ name: 'Dispatch PyTorch events' on: + pull_request: + branches: + - 'main' + paths: + - '.github/workflows/dispatch-event.yml' + - '.github/actions/list-pr/**' + - '!**/*.md' + schedule: - cron: '0 12 * * *' diff --git a/.github/workflows/redispatch-event.yml b/.github/workflows/redispatch-event.yml index d3453c5..a5cea8c 100644 --- a/.github/workflows/redispatch-event.yml +++ b/.github/workflows/redispatch-event.yml @@ -6,7 +6,7 @@ on: jobs: redispatch-pr-event: - name: Redispatch PyTorch events + name: 'Redispatch PyTorch events for #${{ github.event.client_payload.pull_request.number }}' runs-on: ubuntu-latest steps: - name: Checkout