how does one get/set an id of a specific step?? C...
# github-workflows-kt
a
how does one get/set an id of a specific step?? Can I get outputs of a certain step?
p
not possible yet, tracked in https://github.com/krzema12/github-actions-kotlin-dsl/issues/56. I'm working on it
feel free to +1 🙂
one follow-up question: do you need to set the ID only to be able to retrieve the output, or you also have some other use case? I'm planning to support setting an arbitrary ID, but I'm asking because maybe it makes sense to add dedicated support for your other use case when you use the ID
a
My current use case is to just get the output of the said task. So an internal arbitrary id, would suffice
👍 1
🙏 1
n
as a temporary workaround i do some string manipulations on the generated yaml.. to insert the
id:
Copy code
val yaml = workflow.toYaml(addConsistencyCheck = true)
    .replaceFirst(
        """
            |      - name: Build and push
        """.trimMargin(),
        """
            |      - name: Build and push
            |        id: docker_build
        """.trimMargin()
    )

if (args.contains("--save")) {
    workflow.targetFile.writeText(yaml + "\n")
} else {
    println(yaml)
}
hope this snippet helps..
its not pretty but it works for now
a
Damn, that code is ugly 😀
p
within a week or two, the workaround should not be needed 🙂
❤️ 2
👍 2
Handling outputs implemented, later this week I'll add wrappers for some actions that you use and will release the lib