actions / actions/toolkit

core.setOutput should support null separated values

Open
#812 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the enhancement
Currently setOutput escapes new lines, but it would be great if it also escaped the null character so that one can use it to separate array outputs.

Additional information
Right now I'm using a new line to separate the array entries, but that means that if the entries have whitespaces we need to use the following:

echo "${{ steps.changed-files.outputs.files }}" | tr '\n' '\0' | xargs -0 ls -lh

However is setOutput supported null separated bytes, we could just do:

echo "${{ steps.changed-files.outputs.files }}" | xargs -0 ls -lh

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 by locating the TypeScript implementation and tests for setOutput in the toolkit. Check how newline escaping is handled, then define completion as null characters being escaped safely so output can be consumed by xargs -0 without the issue's shell conversion step.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.