-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Core feature request] Add support to Workflow Dispatch Inputs #811
Comments
As you've already noticed, some support for it is already in place (I forgot about it when asking you to create this request, sorry!): Lines 9 to 12 in 9eee511
From what I understand, you're missing a type-safe way of referring to the input values, right? On GitHub, the inputs are available within workflow(
name = "Publish",
on = listOf(
WorkflowDispatch() // After the change, the inputs wouldn't be defined here...
),
sourceFile = __FILE__.toPath(),
) {
// ...but here instead. It's in line with what's already possible with env vars and secrets.
val RELEASE_VERSION by Contexts.input(required = true, type = String)
// ...
// inside a job that actually uses the secret:
run(
name = "Release",
env = linkedMapOf(
VERSION to expr { RELEASE_VERSION },
),
command = "./gradlew release",
)
} WDYT? |
@jmfayard do you recall why we originally haven't implemented it this way? |
@krzema12 we probably implemented WorkflowDispatch before I implemented the typesafe expressions, |
Yes, I think the syntax you presented seems what I expect @krzema12 . Interesting to know it predates the typesafety |
Discussed in Kotlin's Slack: https://app.slack.com/client/T09229ZC6/C02UUATR7RC/thread/C02UUATR7RC-1682902161.628869
What feature do you need?
Workflows Dispatch Inputs:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
Do you have an example usage?
https://github.com/kotest/kotest/blob/80bc809be1e0452dc1f3ee2e67aec2f6c7f6c251/.github/workflows/release_base.yml#L15
Is there a workaround for not having this feature? If yes, please describe it.
Yes. One can use
WorkflowDispatch
normally, and useexpr { github["event.inputs.XXXX"]!! }
to get the value when they need it.The text was updated successfully, but these errors were encountered: