Skip to content

Commit c5c68d9

Browse files
committed
Fix publish jobs' run conditions
Both 'publish-to-test-pypi' and 'publish-to-pypi' jobs are skipped even when a tag is present, which is not the desired behaviour. This commit fixes it by running the two jobs even if the other test jobs are skipped when a tag is present.
1 parent 3a6e9ef commit c5c68d9

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

.github/workflows/test_and_publish.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,10 @@ jobs:
5656
name: Publish to TestPyPI
5757
environment: staging
5858
runs-on: ubuntu-latest
59-
needs:
60-
- is-duplicate
61-
- test-code
59+
needs: [test-code]
6260
if: |
63-
needs.is-duplicate.outputs.should_skip != 'true' &&
64-
github.ref == 'refs/heads/main' &&
65-
github.event_name == 'push'
61+
!failure() &&
62+
startsWith(github.ref, 'refs/tags/')
6663
6764
steps:
6865
- name: Check out code
@@ -90,13 +87,10 @@ jobs:
9087
name: Publish to PyPI
9188
environment: production
9289
runs-on: ubuntu-latest
93-
needs:
94-
- is-duplicate
95-
- publish-to-test-pypi
90+
needs: [publish-to-test-pypi]
9691
if: |
97-
needs.is-duplicate.outputs.should_skip != 'true' &&
98-
github.ref == 'refs/heads/main' &&
99-
github.event_name == 'push'
92+
!failure() &&
93+
startsWith(github.ref, 'refs/tags/')
10094
10195
steps:
10296
- name: Check out code

0 commit comments

Comments
 (0)