Skip to content

Commit 4cec0fc

Browse files
committed
oidc-exchange: input normalization
Signed-off-by: William Woodruff <[email protected]>
1 parent 5cd75b2 commit 4cec0fc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

oidc-exchange.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ def debug(msg: str):
2525
print(f"::debug::{msg}", file=sys.stderr)
2626

2727

28-
repository_url = os.getenv("INPUT_REPOSITORY_URL")
28+
def get_normalized_input(name: str) -> str | None:
29+
name = f"INPUT_{name.upper()}"
30+
if val := os.getenv(name):
31+
return val
32+
return os.getenv(name.replace("-", "_"))
33+
34+
35+
repository_url = get_normalized_input("repository-url")
2936
if not repository_url:
3037
# Easy case: no explicit repository URL, which means we're using PyPI and we can just
3138
# hardcode the exchange endpoint and OIDC audience.

0 commit comments

Comments
 (0)