From 48224ff5ca09189654ff033aad2d61ab1a46eddb Mon Sep 17 00:00:00 2001 From: Maarten de Kruijf Date: Mon, 11 Mar 2024 11:58:50 +0100 Subject: [PATCH] Parse variable names from json playbook on decode --- models/decoder/cacao.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/models/decoder/cacao.go b/models/decoder/cacao.go index 73fc5555..8b847aa6 100644 --- a/models/decoder/cacao.go +++ b/models/decoder/cacao.go @@ -68,5 +68,17 @@ func decode(data []byte) *cacao.Playbook { playbook.AuthenticationInfoDefinitions[key] = auth } + for key, variable := range playbook.PlaybookVariables { + variable.Name = key + playbook.PlaybookVariables.InsertOrReplace(variable) + } + + for _, step := range playbook.Workflow { + for key, variable := range step.StepVariables { + variable.Name = key + step.StepVariables.InsertOrReplace(variable) + } + } + return &playbook }