Skip to content

Commit

Permalink
Plugin subtask: fix templating instructions (escape hyphens)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Schaffer <[email protected]>
  • Loading branch information
loopfz committed Dec 27, 2019
1 parent 6df3ca5 commit 2836f0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engine/templates_tests/foreach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ steps:
conditions:
- type: check
if:
- value: '{{.step.this.output.concat}}'
- value: '{{ index .step "this" "output" "concat"}}'
operator: EQ
expected: foo-c-bar-c
then:
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/builtin/subtask/subtask.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type SubtaskContext struct {

func ctx(stepName string) interface{} {
return &SubtaskContext{
TaskID: fmt.Sprintf("{{if .step.%s.output}}{{.step.%s.output.id}}{{end}}", stepName, stepName),
TaskID: fmt.Sprintf(`{{ if (index .step "%s" "output") }}{{ index .step "%s" "output" "id" }}{{ end }}`, stepName, stepName),
RequesterUsername: "{{.task.requester_username}}",
}
}
Expand Down

0 comments on commit 2836f0f

Please sign in to comment.