From e2fe829ea7019714fd2e387e9c3ae3a32ea88080 Mon Sep 17 00:00:00 2001 From: bossOfCode <95505913+bossOfCode@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:15:41 +0000 Subject: [PATCH] update again --- generate.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/generate.py b/generate.py index 5ca20bb..38666af 100644 --- a/generate.py +++ b/generate.py @@ -3,10 +3,12 @@ import sys import uuid -version = os.environ.get("INPUTS_UUID") +VERSION = os.environ.get("INPUTS_UUID") namespace = os.environ.get("INPUTS_NAMESPACE") name = os.environ.get("INPUTS_NAME") +OUTPUT = "" + versions = [1, 3, 4, 5] namespaces = ["DNS", "URL", "OID", "X500"] @@ -15,28 +17,28 @@ def print_in_os(argument): print(f"{argument}") os.system(f"{argument}") -if version in versions or namespace in namespaces: - if version == 1: - output = str(uuid.uuid1()) +if VERSION in versions or namespace in namespaces: + if VERSION == 1: + OUTPUT = str(uuid.uuid1()) else: - if version == 3: - output = str(uuid.uuid3(str("NAMESPACES_" + namespace), name)) + if VERSION == 3: + OUTPUT = str(uuid.uuid3(str("NAMESPACES_" + namespace), name)) else: - if version == 4: - output = str(uuid.uuid4()) + if VERSION == 4: + OUTPUT = str(uuid.uuid4()) else: - if version == 5: - output = str(uuid.uuid5(str("NAMESPACES_" + namespace), name)) + if VERSION == 5: + OUTPUT = str(uuid.uuid5(str("NAMESPACES_" + namespace), name)) else: if namespace in namespaces: sys.exit(f"ERROR: namespace cannot be {namespace}; must be either DNS, URL, OID, or X500.") else: - if version in versions: - sys.exit(f"ERROR: version {version} does not exist") + if VERSION in versions: + sys.exit(f"ERROR: VERSION {VERSION} does not exist") SAFE = uuid.SafeUUID -print_in_os(f"echo 'uuid={output}' >> $GITHUB_OUTPUT") +print_in_os(f"echo 'uuid={OUTPUT}' >> $GITHUB_OUTPUT") print_in_os(f"echo 'safe={SAFE}' >> $GITHUB_OUTPUT") if SAFE == "unsafe":