Skip to content

Commit ead99d1

Browse files
authored
fix(ci): eliminate duplicate CI runs in tox workflow (#1811)
This change eliminates redundant CI executions by: - Limiting 'push' triggers to only the 'main' branch for post-merge verification - Using 'pull_request' for PR validation to run exactly once per commit - Adding concurrency control to cancel in-progress runs when new commits are pushed Before: Each PR commit triggered CI twice (push + pull_request events) After: Each PR commit triggers CI exactly once (pull_request event only) The workflow still runs on push to main and supports all merge scenarios while preventing resource waste from duplicate executions.
1 parent f5cf060 commit ead99d1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/tox_verify.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Tox
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
412

513
jobs:
614
lint:

0 commit comments

Comments
 (0)