Skip to content

Commit

Permalink
GitHub actions: do not try to publish to PyPI if the secret `PYPI_API…
Browse files Browse the repository at this point in the history
…_TOKEN_SORTABLE2` does not exist.
  • Loading branch information
Andrey Zelenchuk committed Jul 31, 2023
1 parent 42297ad commit 929a4b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ jobs:
- name: Build 🐍 Python 📦 Package
run: python -m build --sdist --wheel --outdir dist/
- name: Publish 🐍 Python 📦 Package to PyPI
if: startsWith(github.ref, 'refs/tags')
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN_SORTABLE2 }}
if: startsWith(github.ref, 'refs/tags/') && (env.PYPI_API_TOKEN != '')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN_SORTABLE2 }}

0 comments on commit 929a4b9

Please sign in to comment.