github-workflows-kt icon indicating copy to clipboard operation
github-workflows-kt copied to clipboard

[Core feature request] Model `outcome` context

Open Vampire opened this issue 2 years ago • 2 comments

What feature do you need? It would be nice if the GitHub contexts are modeled similar to the outputs of actions, so that you can easily access them. https://docs.github.com/en/actions/learn-github-actions/contexts For example what I need right now would be myActionStep.outcome.

Do you have an example usage? YAML:

- run: if '${{ steps.execute_action.outcome }}' NEQ 'failure' exit 1

Current kts:

run(
    command = """
        if '${expr("steps.${executeActionStep.id}.outcome")}' NEQ 'failure' exit 1
    """.trimIndent()
)

Intended kts:

run(
    command = """
        if '${expr(executeActionStep.outcome)}' NEQ 'failure' exit 1
    """.trimIndent()
)

Vampire avatar Jun 18 '22 00:06 Vampire

@jmfayard could you check what's missing in the lib after your recent contribution? So far I see "outcome" scope that @Vampire proposed to add.

krzema12 avatar Jul 13 '22 09:07 krzema12

Narrowing down to just supporting outcome context since this one was requested, and we want to add support for other contexts in a lazy manner.

krzema12 avatar Jul 14 '22 20:07 krzema12