Skip to content

Conversation

@rickstaa
Copy link

@rickstaa rickstaa commented Sep 25, 2022

This PR makes sure that the core.getMultilineInput function can also parse comma-separated lists (i.e. [val1,val2,val3] and val1,val2,val3).

Fixes #184 (comment).

@rickstaa rickstaa requested a review from a team as a code owner September 25, 2022 07:40
@rickstaa rickstaa force-pushed the improve_getMultiLineInput branch 3 times, most recently from d74927b to 6224d95 Compare September 25, 2022 08:24
This commit makes sure that the core.getMultilineInput function can also
parse comma-separated lists (i.e. `[val1,val2,val3]` and `val1,val2,val3`).
@rickstaa rickstaa force-pushed the improve_getMultiLineInput branch from 6224d95 to 688c365 Compare September 25, 2022 08:25
@DmitriyBobrovskiy
Copy link

any update on this?

@shoogle
Copy link

shoogle commented Sep 3, 2023

It would be better to put this in a new function core.getCommaSeparatedInput() or core.getJsonInput().

People might already be using core.getMultilineInput() with list items that contain commas, so it's not safe to start treating commas as a list separator retrospectively.

- uses: myaction
  with:
    multiline-param: |
      item1, with comma
      item2 no comma
      item3, with, several, commas

This list has 3 items according to the current implementation, but your code would parse it as 7 items, potentially breaking the workflow.

@rickstaa
Copy link
Author

rickstaa commented Oct 19, 2023

It would be better to put this in a new function core.getCommaSeparatedInput() or core.getJsonInput().

People might already be using core.getMultilineInput() with list items that contain commas, so it's not safe to start treating commas as a list separator retrospectively.

- uses: myaction
  with:
    multiline-param: |
      item1, with comma
      item2 no comma
      item3, with, several, commas

This list has 3 items according to the current implementation, but your code would parse it as 7 items, potentially breaking the workflow.

Good comment 👍🏻! I've opened issue #1566 to tackle your concerns. Regarding getCommaSeparatedInput, we could also introduce a more versatile getJsonInput function. Unfortunately, I do not have the time right now to implement this 😅.

@iamstarkov
Copy link

@rickstaa I implemented the core.getListInput (comma or new lines separated) in #1926, so if you dont have time to implement it yourself you can review the mentioned PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support list input type

5 participants