From 9faeca23a885f4d4af46877a826194ce2ff60e68 Mon Sep 17 00:00:00 2001 From: chenxsan Date: Sun, 9 Oct 2022 20:09:24 +0800 Subject: [PATCH 1/3] CI: cancel previous runs --- .github/workflows/testing.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 75cdb9529f49..af943a00fe0c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,6 +12,9 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -31,6 +34,9 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -50,6 +56,9 @@ jobs: os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action + - uses: actions/checkout@v3 - name: Vale @@ -67,6 +76,9 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -101,6 +113,9 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action + - uses: actions/checkout@v3 - name: Enable webpack persistent caching From 54ecafc0eacd893caf6cbbf44dfcead3074f5689 Mon Sep 17 00:00:00 2001 From: chenxsan Date: Sun, 9 Oct 2022 20:22:54 +0800 Subject: [PATCH 2/3] Revert "CI: cancel previous runs" This reverts commit 9faeca23a885f4d4af46877a826194ce2ff60e68. --- .github/workflows/testing.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index af943a00fe0c..75cdb9529f49 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,9 +12,6 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action - - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -34,9 +31,6 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action - - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -56,9 +50,6 @@ jobs: os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action - - uses: actions/checkout@v3 - name: Vale @@ -76,9 +67,6 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action - - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -113,9 +101,6 @@ jobs: node-version: [16.x] runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action - - uses: actions/checkout@v3 - name: Enable webpack persistent caching From 3b370188baeb71013a12653e3caed9aae8b38b29 Mon Sep 17 00:00:00 2001 From: chenxsan Date: Sun, 9 Oct 2022 20:32:46 +0800 Subject: [PATCH 3/3] support forked pull requests --- .github/workflows/cancel.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/cancel.yml diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml new file mode 100644 index 000000000000..9f6944b9edce --- /dev/null +++ b/.github/workflows/cancel.yml @@ -0,0 +1,13 @@ +name: Cancel +on: + workflow_run: + workflows: ["Ensure PR"] + types: + - requested +jobs: + cancel: + runs-on: ubuntu-latest + steps: + - uses: styfle/cancel-workflow-action + with: + workflow_id: ${{ github.event.workflow.id }}