typesafegithub / typesafegithub/github-workflows-kt
[Core feature request] Access workflow inputs in Kotlin-based step
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 664
- Forks
- 30
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 5
Description
What feature do you need?
https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#inputs-context
The access could be even type-unsafe for now (just strings).
Do you have an example usage?
run {
println(inputs["myInput"])
}
Is there a workaround for not having this feature? If yes, please describe it.
I'm currently doing something pretty ugly:
val githubContextJson = System.getenv("GHWKT_GITHUB_CONTEXT_JSON")!!
val version: String = Json.parseToJsonElement(githubContextJson)
.jsonObject["event"]
?.jsonObject?.get("inputs")
?.jsonObject?.get("version")
?.jsonPrimitive?.contentOrNull
?: error("Version couldn't be extracted from input")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked GitHub Actions inputs context documentation, then trace how Kotlin-based workflow steps currently expose context and environment data. Implement access matching the example inputs["myInput"] and verify that workflow inputs are available without the JSON environment workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, kotlin
- Domain
- ci-cd
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100