https://kotlinlang.org logo
Title
l

LeoColman

05/01/2023, 12:49 AM
How to take input from the action run button with the lib? Is there any samples I can take a look into?
p

Piotr Krzemiński

05/01/2023, 5:23 AM
Could you share a reference to GitHub docs or perhaps a piece of YAML or a screen shot? I'm not sure if I know what you mean
p

Piotr Krzemiński

05/01/2023, 9:08 AM
That's my guess too, I just want to ensure
Anyway, it looks like a candidate for a proper feature request in GH
l

LeoColman

05/01/2023, 12:41 PM
Yes, I meant workflow dispatch. I didn't remember what it was called
In Kotest we take the input version to pass it to the gradle command. I want to do the same with workflows-kt
p

Piotr Krzemiński

05/01/2023, 12:43 PM
Sure, got it - please cut a feature request :) definitely doable, I even have an idea for an API
FTR, should be possible to work around it using _customArguments
I don't understand how to use customArguments to workaround it tho
Actually, I think the WorkflowDispatch is already supported
We need only a prettified syntax
workflow(
  name = "Publish",
  on = listOf(
    WorkflowDispatch(
      mapOf("RELEASE_VERSION" to Input("The release version", true, String))
    )
  ),
  sourceFile = __FILE__.toPath(),
  env = linkedMapOf(
    "OSSRH_USERNAME" to expr { OSSRH_USERNAME },
    "OSSRH_PASSWORD" to expr { OSSRH_PASSWORD },
    "ORG_GRADLE_PROJECT_signingKey" to expr { ORG_GRADLE_PROJECT_signingKey },
    "ORG_GRADLE_PROJECT_signingPassword" to expr { ORG_GRADLE_PROJECT_signingPassword },
    "RELEASE_VERSION" to expr { github["event.inputs.version"]!! }
  )
)
I've added these details to the ticket.
p

Piotr Krzemiński

05/02/2023, 6:52 AM
thanks, let's continue the discussion in the ticket to preserve continuity