Skip to content

core: getMultilineInput not trimming whitespace #1186

@bicstone

Description

@bicstone

Describe the bug
core.getInput is trimming whitespace by default, but core.getMultilineInput is not.
Also, core.getMultilineInput ignores trimWhitespace option.

To Reproduce

action.yml

# ...
inputs:
  option:
    description: a multiline option

index.js

import * as core from "@actions/core"

const option = core.getMultilineInput("option", {
  trimWhitespace: true,
})

core.info(option)

workflow.yml

# ...
jobs:
  test:
    # ...
    steps:
      - uses: # ...
        with:
          option: |-
             a 
             b 
             c 

-> ["a ", " b ", " c"]

Expected behavior
-> ["a", "b", "c"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions