Skip to content

Commit

Permalink
GHA for automatically canceling previous CI runs (#5025)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 authored Mar 15, 2021
1 parent c7c4aae commit 061bc8e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 24 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/cancel-duplicate-runs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Cancel
on:
workflow_run:
workflows: ["CI", "CI Additional", "CI Upstream"]
types:
- requested
jobs:
cancel:
name: Cancel previous runs
runs-on: ubuntu-latest
steps:
- uses: styfle/[email protected]
with:
workflow_id: ${{ github.event.workflow.id }}
16 changes: 0 additions & 16 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ jobs:
"py38-flaky",
]
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
Expand Down Expand Up @@ -120,10 +116,6 @@ jobs:
shell: bash -l {0}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
Expand Down Expand Up @@ -161,10 +153,6 @@ jobs:
shell: bash -l {0}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
Expand Down Expand Up @@ -205,10 +193,6 @@ jobs:
shell: bash -l {0}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ jobs:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.7", "3.8"]
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ jobs:
outputs:
artifacts_availability: ${{ steps.status.outputs.ARTIFACTS_AVAILABLE }}
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
Expand Down

0 comments on commit 061bc8e

Please sign in to comment.