Skip to content

Commit 2a20416

Browse files
committed
Add concurrency control and restrict publishing
- Introduced concurrency to cancel in-progress runs on the same ref. - Limited workflow execution to the `main` branch.
1 parent 6fde314 commit 2a20416

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/build-python-version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ jobs:
188188
- build-android
189189
- build-linux
190190
- build-windows
191+
if: github.ref == 'refs/heads/main'
191192
steps:
192193
- name: Derive short Python version
193194
shell: bash

.github/workflows/build-python.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: Build Python Packages
22

33
on:
44
push:
5-
branches:
6-
- '**'
5+
pull_request:
76
workflow_dispatch:
87

8+
# Cancel in-flight runs when a newer commit lands on the same ref.
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build-matrix:
1115
name: Build Python ${{ matrix.python_version }}

0 commit comments

Comments
 (0)