Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

CI: Cancel in-progress workflow runs when their pull request is closed (#8029)

Adrian09a5d81e4066
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 331fade61..4aa1ebff3 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -9,6 +9,7 @@ on:
- master
- '[0-9]+.[0-9]+'
pull_request:
+ types: [opened, synchronize, reopened, closed]
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
@@ -16,6 +17,7 @@ concurrency:
jobs:
checks:
+ if: github.event.action != 'closed'
runs-on: ubuntu-latest
env:
# Make uv use the interpreter that actions/setup-python installed instead
@@ -68,6 +70,7 @@ jobs:
run: uvx --with tox-uv tox
pre-commit:
+ if: github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml
index c50576ec7..30f6dafa6 100644
--- a/.github/workflows/codspeed.yml
+++ b/.github/workflows/codspeed.yml
@@ -6,6 +6,7 @@ on:
branches:
- master
pull_request:
+ types: [opened, synchronize, reopened, closed]
paths:
- scrapy/**
- tests/benchmarks/**
@@ -14,13 +15,14 @@ on:
workflow_dispatch:
concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
benchmark:
+ if: github.event.action != 'closed'
runs-on: ubuntu-latest
env:
# Make uv use the interpreter that actions/setup-python installed
diff --git a/.github/workflows/tests-macos.yml b/.github/workflows/tests-macos.yml
index 9a09aa67d..ae1a11735 100644
--- a/.github/workflows/tests-macos.yml
+++ b/.github/workflows/tests-macos.yml
@@ -9,6 +9,7 @@ on:
- master
- '[0-9]+.[0-9]+'
pull_request:
+ types: [opened, synchronize, reopened, closed]
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
@@ -16,6 +17,7 @@ concurrency:
jobs:
tests:
+ if: github.event.action != 'closed'
name: tests (${{ matrix.python-version }}, ${{ matrix.env.TOXENV }})
runs-on: macos-latest
env:
diff --git a/.github/workflows/tests-ubuntu.yml b/.github/workflows/tests-ubuntu.yml
index b58b2af7b..849d99be5 100644
--- a/.github/workflows/tests-ubuntu.yml
+++ b/.github/workflows/tests-ubuntu.yml
@@ -9,6 +9,7 @@ on:
- master
- '[0-9]+.[0-9]+'
pull_request:
+ types: [opened, synchronize, reopened, closed]
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
@@ -16,6 +17,7 @@ concurrency:
jobs:
tests:
+ if: github.event.action != 'closed'
name: tests (${{ matrix.python-version }}, ${{ matrix.env.TOXENV }})
runs-on: ubuntu-latest
env:
diff --git a/.github/workflows/tests-windows.yml b/.github/workflows/tests-windows.yml
index 254e9395e..01727face 100644
--- a/.github/workflows/tests-windows.yml
+++ b/.github/workflows/tests-windows.yml
@@ -9,6 +9,7 @@ on:
- master
- '[0-9]+.[0-9]+'
pull_request:
+ types: [opened, synchronize, reopened, closed]
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
@@ -16,6 +17,7 @@ concurrency:
jobs:
tests:
+ if: github.event.action != 'closed'
name: tests (${{ matrix.python-version }}, ${{ matrix.env.TOXENV }})
runs-on: windows-latest
env: