test input hiding

This commit is contained in:
Bryan Gerlach
2026-01-12 14:12:08 -06:00
parent 56900a2548
commit 7ccf863a8f
2 changed files with 47 additions and 47 deletions

View File

@@ -99,18 +99,18 @@ jobs:
raise e raise e
try: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")
@@ -691,18 +691,18 @@ jobs:
raise e raise e
try: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")
@@ -808,18 +808,18 @@ jobs:
raise e raise e
try: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")
@@ -924,18 +924,18 @@ jobs:
raise e raise e
try: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")

View File

@@ -88,27 +88,27 @@ jobs:
r.raise_for_status() r.raise_for_status()
try: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
api_server = secrets.get('apiServer', '').strip() api_server = secrets.get('apiServer', '').strip()
api_server = api_server.rstrip('/') api_server = api_server.rstrip('/')
rdgen_value = str(secrets.get('rdgen', 'false')).lower() rdgen_value = str(secrets.get('rdgen', 'false')).lower()
if rdgen_value == "true": if rdgen_value == "true":
status_url = "${{ secrets.GENURL }}/updategh" status_url = "${{ secrets.GENURL }}/updategh"
else: else:
status_url = f"{api_server}/api/updategh" status_url = f"{api_server}/api/updategh"
env_file.write(f"STATUS_URL={status_url}\n") env_file.write(f"STATUS_URL={status_url}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")