Skip to content

Commit 7624884

Browse files
committed
CI: cancel old PR jobs
Cancel the previous jobs when a PR is updated. Merge jobs are never cancelled.
1 parent e0f37e0 commit 7624884

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

.github/workflows/deployment_test.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on: # yamllint disable-line rule:truthy
1616
env:
1717
IMAGE_NAME: opendatacube/explorer
1818

19+
# When a PR is updated, cancel the jobs from the previous version. Merges
20+
# do not define head_ref, so use run_id to never cancel those jobs.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
24+
1925
jobs:
2026
deployment-image-test:
2127
runs-on: ubuntu-latest

.github/workflows/doc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
permissions:
1010
pull-requests: write
1111

12+
# When a PR is updated, cancel the jobs from the previous version. Merges
13+
# do not define head_ref, so use run_id to never cancel those jobs.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
1218
jobs:
1319
documentation-preview:
1420
runs-on: ubuntu-latest

.github/workflows/docker.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ on:
1717
env:
1818
IMAGE_NAME: opendatacube/explorer
1919

20+
# When a PR is updated, cancel the jobs from the previous version. Merges
21+
# do not define head_ref, so use run_id to never cancel those jobs.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
2026
jobs:
2127
docker:
2228
runs-on: ubuntu-latest

.github/workflows/scan.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
env:
88
IMAGE_NAME: opendatacube/explorer
99

10+
# When a PR is updated, cancel the jobs from the previous version. Merges
11+
# do not define head_ref, so use run_id to never cancel those jobs.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
1016
jobs:
1117
cve-scanner:
1218
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on:
1616
env:
1717
IMAGE_NAME: opendatacube/explorer
1818

19+
# When a PR is updated, cancel the jobs from the previous version. Merges
20+
# do not define head_ref, so use run_id to never cancel those jobs.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
24+
1925
jobs:
2026
integration-tests:
2127
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)