Skip to content

Commit f387a16

Browse files
committed
Merge remote-tracking branch 'upstream/unstable/v1' into tob-oidc
2 parents 0d85464 + 22b4d1f commit f387a16

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

twine-upload.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,29 @@ if [[ "${INPUT_USER}" == "__token__" && -z "${INPUT_PASSWORD}" ]] ; then
4646
INPUT_PASSWORD="$(python /app/oidc-exchange.py)"
4747
fi
4848

49+
function get-normalized-input() {
50+
local var_name=${1}
51+
python -c \
52+
'
53+
from os import getenv
54+
from sys import argv
55+
envvar_name = f"INPUT_{argv[1].upper()}"
56+
print(
57+
getenv(envvar_name) or getenv(envvar_name.replace("-", "_")) or "",
58+
end="",
59+
)
60+
' \
61+
"${var_name}"
62+
}
63+
64+
65+
INPUT_REPOSITORY_URL="$(get-normalized-input 'repository-url')"
66+
INPUT_PACKAGES_DIR="$(get-normalized-input 'packages-dir')"
67+
INPUT_VERIFY_METADATA="$(get-normalized-input 'verify-metadata')"
68+
INPUT_SKIP_EXISTING="$(get-normalized-input 'skip-existing')"
69+
INPUT_PRINT_HASH="$(get-normalized-input 'print-hash')"
70+
71+
4972
if [[
5073
"$INPUT_USER" == "__token__" &&
5174
! "$INPUT_PASSWORD" =~ ^pypi-

0 commit comments

Comments
 (0)