diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index 77abd91c8..5e8386898 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -100,7 +100,8 @@ jobs: needs: [sdist, wheels] runs-on: ubuntu-latest # Only publish to PyPi if the tag is not a pre-release OR if manually triggered - if: ${{ (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')) || github.event_name == 'workflow_dispatch' }} + # Note, `workflow_run.head_branch` does not contain `refs/tags/` prefix, just the tag name, i.e. `v0.4.0` or `v0.4.0-rc.1` + if: ${{ !contains(github.event.workflow_run.head_branch, '-') || github.event_name == 'workflow_dispatch' }} environment: name: pypi