Skip to content

Commit 3fdcddc

Browse files
committed
use github.event.workflow_run.head_branch
1 parent 7ee2c19 commit 3fdcddc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/release_python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ jobs:
9999
name: Publish Python 🐍 distribution 📦 to Pypi
100100
needs: [sdist, wheels]
101101
runs-on: ubuntu-latest
102+
# Only publish to PyPi if the tag is not a pre-release OR if manually triggered
103+
if: ${{ (startsWith(github.event.workflow_run.head_branch, 'refs/tags/') && !contains(github.event.workflow_run.head_branch, '-')) || github.event_name == 'workflow_dispatch' }}
102104

103105
environment:
104106
name: pypi

0 commit comments

Comments
 (0)