#2: Fix argument to write() vs writelines()

This commit is contained in:
mtkennerly 2023-03-28 15:52:22 +08:00
parent 004550a190
commit 874636536a
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408

View file

@ -11,13 +11,13 @@ def run_command(command: str) -> str:
def set_output(name: str, value: str) -> None: def set_output(name: str, value: str) -> None:
with open(os.environ["GITHUB_OUTPUT"], "a") as file: with open(os.environ["GITHUB_OUTPUT"], "a") as file:
file.write(["{}={}\n".format(name, value)]) file.write("{}={}\n".format(name, value))
def export_variable(name: str, value: str) -> None: def export_variable(name: str, value: str) -> None:
print("Setting environment variable: {}".format(name)) print("Setting environment variable: {}".format(name))
with open(os.environ["GITHUB_ENV"], "a") as file: with open(os.environ["GITHUB_ENV"], "a") as file:
file.write(["{}={}\n".format(name, value)]) file.write("{}={}\n".format(name, value))
def set_failed(error: Exception) -> None: def set_failed(error: Exception) -> None: