Skip to content

Commit 3063966

Browse files
committed
oidc-exchange: "fix" multiline annotations
Signed-off-by: William Woodruff <[email protected]>
1 parent a56da0b commit 3063966

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

oidc-exchange.py

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def die(msg: str) -> NoReturn:
7474
with _GITHUB_STEP_SUMMARY.open("a", encoding="utf-8") as io:
7575
print(_ERROR_SUMMARY_MESSAGE.format(message=msg), file=io)
7676

77+
# HACK: GitHub Actions' annotations don't work across multiple lines naively;
78+
# translating `\n` into `%0A` (i.e., HTML percent-encoding) is known to work.
79+
# See: https://github.com/actions/toolkit/issues/193
80+
msg = msg.replace("\n", "%0A")
7781
print(f"::error::Trusted publishing exchange failure: {msg}", file=sys.stderr)
7882
sys.exit(1)
7983

0 commit comments

Comments
 (0)