From 2325177112ff252119f815c3996eca1c2ca64eb8 Mon Sep 17 00:00:00 2001 From: Andreas Olsson Date: Sun, 31 Mar 2024 11:33:07 +0200 Subject: [PATCH] WIP: put add-mask in helper function --- vault_oidc_ssh_cert_action.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vault_oidc_ssh_cert_action.py b/vault_oidc_ssh_cert_action.py index f87514f..cc024d4 100644 --- a/vault_oidc_ssh_cert_action.py +++ b/vault_oidc_ssh_cert_action.py @@ -10,6 +10,10 @@ class VoscaError(Exception): pass +def _mask_value(secret: str) -> None: + print(f"::add-mask::{secret}") + + def _set_error_message(title: str, message: str) -> None: print(f"::error title={title}::{message}") @@ -105,7 +109,7 @@ def github_vault_auth() -> None: vault_server, oidc_backend, oidc_role, jwt_token ) - print(f"::add-mask::{vault_token}") + _mask_value(vault_token) with open(os.environ["GITHUB_OUTPUT"], mode="a", encoding="utf-8") as ghof: ghof.write(f"vault_token={vault_token}\n")