From 22b4d1f12511f2696162c08546dafbaa903448a2 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 11 Mar 2023 03:06:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Make=20kebab=20options=20fall=20?= =?UTF-8?q?back=20for=20snake=5Fcase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous release didn't take into account the action defaults so the promised fallbacks for the old input names didn't work. This patch corrects that mistake. --- action.yml | 8 ++++---- twine-upload.sh | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 8a2a88df..a657ca5c 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,7 @@ inputs: packages-dir: # Canonical alias for `packages_dir` description: The target directory for distribution required: false - default: dist + # default: dist # TODO: uncomment once alias removed packages_dir: # DEPRECATED ALIAS; TODO: Remove in v3+ description: >- [DEPRECATED] @@ -36,7 +36,7 @@ inputs: verify-metadata: # Canonical alias for `verify_metadata` description: Check metadata before uploading required: false - default: 'true' + # default: 'true' # TODO: uncomment once alias removed verify_metadata: # DEPRECATED ALIAS; TODO: Remove in v3+ description: >- [DEPRECATED] @@ -51,7 +51,7 @@ inputs: Do not fail if a Python package distribution exists in the target package index required: false - default: 'false' + # default: 'false' # TODO: uncomment once alias removed skip_existing: # DEPRECATED ALIAS; TODO: Remove in v3+ description: >- [DEPRECATED] @@ -69,7 +69,7 @@ inputs: print-hash: # Canonical alias for `print_hash` description: Show hash values of files to be uploaded required: false - default: 'false' + # default: 'false' # TODO: uncomment once alias removed print_hash: # DEPRECATED ALIAS; TODO: Remove in v3+ description: >- [DEPRECATED] diff --git a/twine-upload.sh b/twine-upload.sh index e7ef6428..935272d6 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -25,7 +25,10 @@ function get-normalized-input() { from os import getenv from sys import argv envvar_name = f"INPUT_{argv[1].upper()}" -print(getenv(envvar_name, getenv(envvar_name.replace("-", "_"), "")), end="") +print( + getenv(envvar_name) or getenv(envvar_name.replace("-", "_")) or "", + end="", +) ' \ "${var_name}" }