Add option to prevent removing empty lines in getMultilineInput
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
The getMultilineInput function currently uses a filter to remove empty lines from the input.
It would be convenient to disable this behavior since the empty lines could be from a pre-formatted string. (For example, my use case is creating a comment with output from Terraform. Since empty lines are removed, the output is much less readable).
There is a workaround, which is to use the getInput function, but it would be convenient to have this behavior built in to the getMultilineInput function itself.
Code Snippet
For example, if there was an option added called filterEmptyLines of type boolean, it could be used like
import * as core from "@actions/core"
const strWithEmptyLines = core.getMultilineInput("my_string", { filterEmptyLines: false })
Doing it this way will make the behavior opt-in and backwards compatible.
Happy to do a PR for this :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at packages/core/src/core.ts around the getMultilineInput implementation linked in the issue. Review how its current filtering handles empty lines and the surrounding public API before checking the existing core package tests. Done means an option can preserve empty lines while the default behavior remains backward compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, developer-experience
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100