Skip to content

Commit 20040cf

Browse files
committed
validation is added. formatting fixed
1 parent 3ff9dd4 commit 20040cf

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

actions/publish_pypi/action.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ inputs:
1414
description: "Applies a set of rules depending on the environment. Available values: (dev|release|nightly|custom)"
1515
required: true
1616

17-
custom_package_name:
18-
description: "Custom package name could be used along wtih the 'custom' build_type"
19-
required: false
17+
custom_package_name:
18+
description: "Custom package name could be used along wtih the 'custom' build_type"
19+
required: false
2020

2121
outputs:
2222
whlname:
@@ -30,6 +30,17 @@ runs:
3030
using: "composite"
3131

3232
steps:
33+
- name: Validate input parameters
34+
run: |
35+
if [ "${{ inputs.publish_pypi }}" == "false" ] && [ "${{ inputs.publish_pypi_internal }}" == "false" ]; then
36+
echo "Error: At least one of 'publish_pypi' or 'publish_pypi_internal' must be set to 'true'"
37+
exit 1
38+
fi
39+
if [ "${{ inputs.built_type }}" == "custom" ] && [ "${{ inputs.custom_package_name }}" == "" ]; then
40+
echo "Error: If 'built_type' is set to 'custom' the 'custom_package_name' must be specified"
41+
exit 1
42+
fi
43+
3344
- name: Install tox
3445
run: python3 -m pip install --user tox build
3546

0 commit comments

Comments
 (0)