github-workflows-kt
github-workflows-kt copied to clipboard
[Bug] encoding multi-line values does not work properly
Action
run(
condition = """
always()
&& (steps.${executeAction.id}.outcome == 'success')
""".trimIndent(),
command = "true"
)
Expected
No exception
Actual
[...]
- id: step-2
run: true
if: always()
&& (steps.step-1.outcome == 'success')
[...]
com.charleskorn.kaml.MalformedYamlException at jobs.test_default_distribution.steps[2] on line 100, column 8: while scanning an anchor
at line 100, column 7:
&& (steps.step-1.outcome == 'success')
^
unexpected character found &(38)
at line 100, column 8:
&& (steps.step-1.outcome == 'success')
^
at com.charleskorn.kaml.YamlParser.translateYamlEngineException(YamlParser.kt:89)
Workaround, if exists
run(
condition = """
always()
&& (steps.${executeAction.id}.outcome == 'success')
""".trimIndent(),
command = "true"
)
Library version
v0.23.0
See https://github.com/krzema12/github-actions-kotlin-dsl/issues/80#issuecomment-1200504222, it will be fixed in scope of that task.
After addressing #80, it's now encoded properly by snakeyaml.