From b20a8792efce445797cbbd0f9037ad092f6e1acb Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Thu, 28 Jan 2021 15:29:31 +0100 Subject: [PATCH] Created cancelling workflow. --- .github/workflows/cancelling.yml | 20 ++++++++++++++++++++ .github/workflows/docker.yml | 7 +------ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/cancelling.yml diff --git a/.github/workflows/cancelling.yml b/.github/workflows/cancelling.yml new file mode 100644 index 0000000000..ca8ec52261 --- /dev/null +++ b/.github/workflows/cancelling.yml @@ -0,0 +1,20 @@ +name: Cancelling +on: + workflow_run: + workflows: ['CI'] + types: ['requested'] + +jobs: + cancel-duplicate-workflow-runs: + name: "Cancel duplicate workflow runs" + runs-on: ubuntu-latest + steps: + - uses: potiuk/cancel-workflow-runs@master + name: "Cancel duplicate workflow runs" + with: + cancelMode: duplicates + cancelFutureDuplicates: true + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + notifyPRCancel: true + skipEventTypes: '["push", "schedule"]' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a78a0191e1..423cc5ccd9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,12 +7,7 @@ on: jobs: build-master-docker: runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.7.0 - with: - access_token: ${{ github.token }} - + steps: - name: Checkout code uses: actions/checkout@v2 -- 2.39.5