From 13e6d0c52e5dd63bf6fbf5434731dc4997ecfc82 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Mon, 5 Jun 2023 12:51:56 +0100 Subject: [PATCH] Conditionally run the whole publish. --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81b86adc..9acf98cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,8 +191,9 @@ jobs: pypi-publish: - # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert name: Check tag and publish + # Only trigger this for tag changes. + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest environment: release-pypi permissions: @@ -226,11 +227,9 @@ jobs: run: ls --recursive dist/ - name: Check matched tag version and branch version - on tag - if: startsWith(github.ref, 'refs/tags/') run: python admin/check_tag_version_match.py "${{ github.ref }}" - name: Publish to PyPI - on tag - if: startsWith(github.ref, 'refs/tags/') uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598