Skip to content

Commit 13e6d0c

Browse files
committed
Conditionally run the whole publish.
1 parent 6b9b85a commit 13e6d0c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ jobs:
191191

192192

193193
pypi-publish:
194-
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
195194
name: Check tag and publish
195+
# Only trigger this for tag changes.
196+
if: startsWith(github.ref, 'refs/tags/')
196197
runs-on: ubuntu-latest
197198
environment: release-pypi
198199
permissions:
@@ -226,11 +227,9 @@ jobs:
226227
run: ls --recursive dist/
227228

228229
- name: Check matched tag version and branch version - on tag
229-
if: startsWith(github.ref, 'refs/tags/')
230230
run: python admin/check_tag_version_match.py "${{ github.ref }}"
231231

232232
- name: Publish to PyPI - on tag
233-
if: startsWith(github.ref, 'refs/tags/')
234233
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598
235234

236235

0 commit comments

Comments
 (0)