Skip to content

Commit 32b5e93

Browse files
authored
Merge pull request #122 from colindean/empty-token
This patch implements displaying a warning when the password input passed in to the action is empty.
2 parents d2ce3ec + efcb9ba commit 32b5e93

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

twine-upload.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,25 @@ if [[
2323
! "$INPUT_PASSWORD" =~ ^pypi-
2424
]]
2525
then
26-
echo \
27-
::warning file='# >>' PyPA publish to PyPI GHA'%3A' \
28-
POTENTIALLY INVALID TOKEN \
29-
'<< ':: \
30-
It looks like you are trying to use an API token to \
31-
authenticate in the package index and your token value does \
32-
not start with '"pypi-"' as it typically should. This may \
33-
cause an authentication error. Please verify that you have \
34-
copied your token properly if such an error occurs.
26+
if [[ -z "$INPUT_PASSWORD" ]]; then
27+
echo \
28+
::warning file='# >>' PyPA publish to PyPI GHA'%3A' \
29+
EMPTY TOKEN \
30+
'<< ':: \
31+
It looks like you have not passed a password or it \
32+
is otherwise empty. Please verify that you have passed it \
33+
directly or, preferably, through a secret.
34+
else
35+
echo \
36+
::warning file='# >>' PyPA publish to PyPI GHA'%3A' \
37+
POTENTIALLY INVALID TOKEN \
38+
'<< ':: \
39+
It looks like you are trying to use an API token to \
40+
authenticate in the package index and your token value does \
41+
not start with '"pypi-"' as it typically should. This may \
42+
cause an authentication error. Please verify that you have \
43+
copied your token properly if such an error occurs.
44+
fi
3545
fi
3646

3747
if ( ! ls -A ${INPUT_PACKAGES_DIR%%/}/*.tar.gz &> /dev/null && \

0 commit comments

Comments
 (0)