Skip to content

Commit

Permalink
Fix bad workflow dispatch publish toggle by inverting with disable-pu…
Browse files Browse the repository at this point in the history
…blish inputs
  • Loading branch information
ketozhang committed Apr 29, 2024
1 parent 3e9ee85 commit d48b63f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ on:
types: [published]
workflow_dispatch:
inputs:
publish:
disable-publish:
description: |
Should publish to PyPA (default false for manual runs). Artifacts are
Disables publish to PyPA (default, true for manual runs). Artifacts are
available in both cases.
default: false
default: true
type: boolean

env:
PUBLISH: ${{ inputs.publish == '' && true || inputs.publish }} # Default true for automatic runs

jobs:

build_wheels:
Expand Down Expand Up @@ -96,7 +93,7 @@ jobs:
path: dist/

- name: Publish package to PyPI
if: ${{ env.PUBLISH }}
if: ! ${{ inputs.disable-publish || false }} # Only skips if inputs.disable-publish is true
# All files in dist/ are published
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit d48b63f

Please sign in to comment.