Emit a warning if the token looks invalid

Resolves #9
This commit is contained in:
Sviatoslav Sydorenko 2019-09-12 14:38:56 +02:00
parent 48259af24d
commit e4638127f9
No known key found for this signature in database
GPG Key ID: 9345E8FEA89CA455
1 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,22 @@
#! /usr/bin/env bash
set -Eeuo pipefail
if [[
"$INPUT_USER" == "__token__" &&
! "$INPUT_PASSWORD" =~ ^pypi-
]]
then
>&2 echo \
[WARNING]: \
It looks like you are trying to use an API token to \
authenticate in the package index and your token value does \
not start with '"pypi-"' as it typically should. This may \
cause an authentication error. Please verify that you have \
copied your token properly if such an error occurs.
fi
TWINE_USERNAME="$INPUT_USER" \
TWINE_PASSWORD="$INPUT_PASSWORD" \
TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \