-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support list input type #184
Comments
I was going through https://github.com/actions/cache trying to implement multiple path support, and when going through source code, I only noticed the Then, later, I found this: const restoreKeys = core
.getInput(Inputs.RestoreKeys)
.split("\n")
.filter(x => x !== ""); so, is let vals: string[] = core.getInput('inputName').split("\n").filter(x => x !== ""); the official way of doing it? If so, I've created a PR to implement this: #336 |
Was this fixed with #829? |
@AB-xdev, as far as I can tell, #829 implements support for values spanning multiple lines, not lists. With the implemented - uses: myaction
with:
multiline-param: |
line1
line2
line3 However, the following is still not possible: - uses: myaction
with:
list-param: ['item1', 'item2', 'item3'] Neither is this: - uses: myaction
with:
list-param:
- item1
- item2
- item3 |
I'm happy with this workaround posted on StackOverflow:
Example: on:
workflow_dispatch:
inputs:
products:
description: "List of Products"
default: '["yellow"]'
limits:
description: "List of limits"
default: '[50]'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
product: ${{ fromJSON(github.event.inputs.products) }}
limits: ${{ fromJSON(github.event.inputs.limits) }} |
can we have this pwease :3 |
This commit adds a 'getCommaSeparatedInput' method to fix actions#184.
Thank you 🙇♀ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.
If your issue is relevant to this repository, please include the information below:
Describe the enhancement
An action should be able to have an input type which is a list of strings. The toolkit should provide a getInput overload or new method to retrieve it.
Code Snippet
Additional information
Add any other context about the feature here.
The text was updated successfully, but these errors were encountered: