Skip to content

Commit 061bc8e

Browse files
authored
GHA for automatically canceling previous CI runs (#5025)
1 parent c7c4aae commit 061bc8e

File tree

4 files changed

+14
-24
lines changed

4 files changed

+14
-24
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Cancel
2+
on:
3+
workflow_run:
4+
workflows: ["CI", "CI Additional", "CI Upstream"]
5+
types:
6+
- requested
7+
jobs:
8+
cancel:
9+
name: Cancel previous runs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: styfle/[email protected]
13+
with:
14+
workflow_id: ${{ github.event.workflow.id }}

.github/workflows/ci-additional.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ jobs:
4545
"py38-flaky",
4646
]
4747
steps:
48-
- name: Cancel previous runs
49-
uses: styfle/[email protected]
50-
with:
51-
access_token: ${{ github.token }}
5248
- uses: actions/checkout@v2
5349
with:
5450
fetch-depth: 0 # Fetch all history for all branches and tags.
@@ -120,10 +116,6 @@ jobs:
120116
shell: bash -l {0}
121117

122118
steps:
123-
- name: Cancel previous runs
124-
uses: styfle/[email protected]
125-
with:
126-
access_token: ${{ github.token }}
127119
- uses: actions/checkout@v2
128120
with:
129121
fetch-depth: 0 # Fetch all history for all branches and tags.
@@ -161,10 +153,6 @@ jobs:
161153
shell: bash -l {0}
162154

163155
steps:
164-
- name: Cancel previous runs
165-
uses: styfle/[email protected]
166-
with:
167-
access_token: ${{ github.token }}
168156
- uses: actions/checkout@v2
169157
with:
170158
fetch-depth: 0 # Fetch all history for all branches and tags.
@@ -205,10 +193,6 @@ jobs:
205193
shell: bash -l {0}
206194

207195
steps:
208-
- name: Cancel previous runs
209-
uses: styfle/[email protected]
210-
with:
211-
access_token: ${{ github.token }}
212196
- uses: actions/checkout@v2
213197
with:
214198
fetch-depth: 0 # Fetch all history for all branches and tags.

.github/workflows/ci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ jobs:
3737
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
3838
python-version: ["3.7", "3.8"]
3939
steps:
40-
- name: Cancel previous runs
41-
uses: styfle/[email protected]
42-
with:
43-
access_token: ${{ github.token }}
4440
- uses: actions/checkout@v2
4541
with:
4642
fetch-depth: 0 # Fetch all history for all branches and tags.

.github/workflows/upstream-dev-ci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ jobs:
4747
outputs:
4848
artifacts_availability: ${{ steps.status.outputs.ARTIFACTS_AVAILABLE }}
4949
steps:
50-
- name: Cancel previous runs
51-
uses: styfle/[email protected]
52-
with:
53-
access_token: ${{ github.token }}
5450
- uses: actions/checkout@v2
5551
- uses: conda-incubator/setup-miniconda@v2
5652
with:

0 commit comments

Comments
 (0)