actions / actions/toolkit

Multiline annotations are not correctly displayed.

Open
#1,507 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
The Command class uses escaping to transform multi-line messages into a single-line annotation:
https://github.com/actions/toolkit/blob/7b617c260dff86f8d044d5ab0425444b29fa0d18/packages/core/src/command.ts#L80-L85

While browsers correctly resolved the %-escaped chars in the past, it seems to fail nowadays as can be seen in this build.

To Reproduce

  1. Generate a multi-line annotation, e.g. via the escaped output:
    echo "::warning::multi%0Aline"
  2. Output generated in build https://github.com/rhaschke/test/actions/runs/5961263674 is:
    multi line

Expected behavior

multi
line

Screenshots
image

Desktop (please complete the following information):
Browser: Google Chrome, version 116.0.5845.110 (Official Build)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/core/src/command.ts at the escaping logic linked in the issue, then reproduce the problem with the shown :⚠️:multi%0Aline command. Done means the annotation renders as two lines rather than a single line in the linked GitHub Actions build.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.