Skip to content
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

Github workflow parameter types too narrow #1819

Closed
y-nk opened this issue Sep 7, 2021 · 3 comments
Closed

Github workflow parameter types too narrow #1819

y-nk opened this issue Sep 7, 2021 · 3 comments

Comments

@y-nk
Copy link

y-nk commented Sep 7, 2021

Description of the JSON schema.

required_contexts should allow [] such as: required_contexts: []

Supporting information.

image

image

@ngraef
Copy link
Contributor

ngraef commented Oct 16, 2021

Action inputs are strings. Numbers and booleans are allowed for convenience when writing yaml, but they get converted to strings too. In this case, octokit/request-action would need to support parsing an array from a string representation — CSV, JSON, or multiline string for example. Have you tried passing the empty array as a string like required_contexts: '[]'?

@y-nk
Copy link
Author

y-nk commented Oct 18, 2021

The github action expects an array, not a string containing brackets. Of course this would solve the schemastore issue since the type would become string, but the api call would fail since it doesn't expect a string.

@ngraef
Copy link
Contributor

ngraef commented Oct 18, 2021

The github action expects an array, not a string containing brackets.

Structured input (maps and lists) cannot be passed to an action as an input value unless it is represented as a string. That's a limitation of the GitHub Actions runner, and the schema in SchemaStore simply reflects that behavior. It is the responsibility of octokit/request-action to accept a stringified array representation (for example, '[]') and correctly parse that value and send it to the GitHub API as an array.

@y-nk y-nk closed this as completed Dec 29, 2022
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

No branches or pull requests

2 participants