Skip to content

Commit e463812

Browse files
committed
Emit a warning if the token looks invalid
Resolves #9
1 parent 48259af commit e463812

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

twine-upload.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
#! /usr/bin/env bash
22
set -Eeuo pipefail
33

4+
5+
if [[
6+
"$INPUT_USER" == "__token__" &&
7+
! "$INPUT_PASSWORD" =~ ^pypi-
8+
]]
9+
then
10+
>&2 echo \
11+
[WARNING]: \
12+
It looks like you are trying to use an API token to \
13+
authenticate in the package index and your token value does \
14+
not start with '"pypi-"' as it typically should. This may \
15+
cause an authentication error. Please verify that you have \
16+
copied your token properly if such an error occurs.
17+
fi
18+
19+
420
TWINE_USERNAME="$INPUT_USER" \
521
TWINE_PASSWORD="$INPUT_PASSWORD" \
622
TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \

0 commit comments

Comments
 (0)