DEVX-48: fix: use heredoc syntax for multi-line $GITHUB_ENV values

This commit is contained in:
emil
2026-06-25 17:12:20 +00:00
parent d7d90fe165
commit 4df0602157
2 changed files with 23 additions and 1 deletions
+6 -1
View File
@@ -55,7 +55,12 @@ def _write_github_env(key: str, value: str) -> None:
if not gh_env:
raise click.ClickException("GITHUB_ENV environment variable is not set")
with open(gh_env, "a") as f: # noqa: PTH123
f.write(f"{key}={value}\n")
if "\n" in value:
# Multi-line values require the heredoc syntax in $GITHUB_ENV.
delimiter = "EOF"
f.write(f"{key}<<{delimiter}\n{value}\n{delimiter}\n")
else:
f.write(f"{key}={value}\n")
@click.command()