From 72dbd411069c2be24cb54fe898b72c8112e2532f Mon Sep 17 00:00:00 2001 From: pseusys Date: Sun, 26 Feb 2023 10:40:58 +0100 Subject: [PATCH] readme content multiline fixed --- sources/manager_environment.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sources/manager_environment.py b/sources/manager_environment.py index 7436ce2..777ba9e 100644 --- a/sources/manager_environment.py +++ b/sources/manager_environment.py @@ -1,4 +1,6 @@ from os import getenv, environ +from random import choice +from string import ascii_letters class EnvironmentManager: @@ -51,6 +53,9 @@ class EnvironmentManager: def set_github_output(name: str, content: str): if "GITHUB_OUTPUT" not in environ.keys(): raise Exception("Not in GitHub environment ('GITHUB_OUTPUT' not defined)!") + eol = "".join(choice(ascii_letters) for _ in range(10)) escaped = content.replace("%", "%25").replace("\n", "%0A").replace("\r", "%0D") with open(environ["GITHUB_OUTPUT"], "a") as fh: - fh.write(f"{name}={escaped}") + fh.write(f"{name}<<{eol}") + fh.write(escaped) + fh.write(eol)