Skip to content

Commit

Permalink
🐛 Make kebab options fall back for snake_case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
webknjaz committed Mar 11, 2023
1 parent 7104b6e commit 22b4d1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion twine-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down

0 comments on commit 22b4d1f

Please sign in to comment.