actions / actions/toolkit

`exec` can potentially lose output when using `stdline` and `errline` callbacks

Open
#1,313 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
Registering a stdline callback and doing an exec, the callback is never invoked for a command that produces output which does not contains platform newlines.

To Reproduce
I have not narrowed this down to a small test case since this is part of a larger application. It should be possible to reproduce by using the stdline callback with a command that emits output but never generates a newline.

Additional context
I am not a JavaScript developer. This occurred during debugging of an issue where the application produced output, but the stdline callback was never invoked. Part of the issue seemed to be the fact that there were no platform newlines in this output. Reading the toolrunner code, I see some sort of emit calls that look like they are meant to take care of any output that has not been sent to the callbacks, but I cannot find any higher level code that would react to this in exec. I'm also unclear why the callbacks would not be invoked directly for the remaining output.

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/exec/src/toolrunner.ts around the linked line 525 and trace how output without platform newlines is emitted and passed to stdline and errline callbacks. Reproduce with a command that emits output without a newline, then verify that the remaining output reaches the appropriate callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.