Skip to content

Commit

Permalink
WIP: set output fuction
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaso committed Apr 1, 2024
1 parent aa6596a commit 5573dcf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions vault_oidc_ssh_cert_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def _set_warning_message(title: str, message: str) -> None:
print(f"::warning title={title}::{message}")


def _set_step_output(name: str, value: str) -> None:
with open(os.environ["GITHUB_OUTPUT"], mode="a", encoding="utf-8") as ghof:
ghof.write(f"{name}={value}\n")


def _determine_audience(input_audience: str, vault_server: str) -> str:
if input_audience:
return input_audience
Expand Down Expand Up @@ -173,8 +178,7 @@ def run() -> None:
vault_server, vault_token, ssh_backend, ssh_role
)

with open(os.environ["GITHUB_OUTPUT"], mode="a", encoding="utf-8") as ghof:
ghof.write(f"cert_path={cert_path}\n")
ghof.write(f"key_path={key_path}\n")
_set_step_output("cert_path", cert_path)
_set_step_output("key_path", key_path)

_revoke_token(vault_server, vault_token)

0 comments on commit 5573dcf

Please sign in to comment.