Skip to content

Commit c3a46b0

Browse files
authored
[ci] fix pypi publishing trigger (#1444)
## Which issue does this PR close? ## What changes are included in this PR? Follow up to #1379. This PR changes the pypi publishing step to trigger on previous workflow's successful run Also see #1325 (comment) ## Are these changes tested? yes, tested the new logic ``` if: ${{ !contains(github.event.workflow_run.head_branch, '-') || github.event_name == 'workflow_dispatch' }} ``` by pushing a new tag to my fork and checking the github workflow run - [publish](https://github.com/kevinjqliu/iceberg-rust/actions/runs/15658709460/job/44113281419) - [pypi](https://github.com/kevinjqliu/iceberg-rust/actions/runs/15658721165/job/44113329600), the job triggered
1 parent 789c52b commit c3a46b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/release_python.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ jobs:
100100
needs: [sdist, wheels]
101101
runs-on: ubuntu-latest
102102
# Only publish to PyPi if the tag is not a pre-release OR if manually triggered
103-
if: ${{ (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')) || github.event_name == 'workflow_dispatch' }}
103+
# 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`
104+
if: ${{ !contains(github.event.workflow_run.head_branch, '-') || github.event_name == 'workflow_dispatch' }}
104105

105106
environment:
106107
name: pypi

0 commit comments

Comments
 (0)