mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 18:15:02 +00:00
ci: fail the PyPI publish workflow on an unknown target
A caller passing a target other than pypi or testpypi would skip both publish jobs and upload nothing; the build job now fails with the value instead. Empty (the release event) stays valid.
This commit is contained in:
1 parent
fa34e0dc01
commit
9e1cead170
1 file changed
+9
@@ -50,6 +50,15 @@ jobs:
|
||||
# A publishing workflow must not restore a cache another job could have poisoned.
|
||||
enable-cache: false
|
||||
|
||||
- name: The publish target is one this workflow knows
|
||||
# A caller's typo would otherwise skip both publish jobs and upload nothing.
|
||||
if: inputs.target != '' && inputs.target != 'pypi' && inputs.target != 'testpypi'
|
||||
env:
|
||||
TARGET: ${{ inputs.target }}
|
||||
run: |
|
||||
echo "::error::unknown target '$TARGET': expected pypi or testpypi"
|
||||
exit 1
|
||||
|
||||
- name: Build the sdist and wheel
|
||||
run: uv build
|
||||
|
||||
|
||||
Reference in new issue
Block a user