From 2168a5396de1d9a89d08b45f943734124375d564 Mon Sep 17 00:00:00 2001 From: Chitrang Patel Date: Thu, 14 Dec 2023 12:01:07 -0500 Subject: [PATCH] example passes --- pkg/apis/pipeline/v1/resultref.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/apis/pipeline/v1/resultref.go b/pkg/apis/pipeline/v1/resultref.go index a4b98eef220..83109360507 100644 --- a/pkg/apis/pipeline/v1/resultref.go +++ b/pkg/apis/pipeline/v1/resultref.go @@ -148,10 +148,12 @@ func stripVarSubExpression(expression string) string { // - Output: "", "", nil, "", error // TODO: may use regex for each type to handle possible reference formats func parseExpression(substitutionExpression string) (string, string, *int, string, ParamType, error) { - if looksLikeResultRef(substitutionExpression) { + if looksLikeResultRef(substitutionExpression) || looksLikeStepResultRef(substitutionExpression) { subExpressions := strings.Split(substitutionExpression, ".") // For string result: tasks..results. + // For string step result: steps..results. // For array result: tasks..results.[index] + // For array step result: steps..results.[index] if len(subExpressions) == 4 { resultName, stringIdx := ParseResultName(subExpressions[3]) if stringIdx != "" { @@ -164,6 +166,7 @@ func parseExpression(substitutionExpression string) (string, string, *int, strin return subExpressions[1], resultName, nil, "", ParamTypeString, nil } else if len(subExpressions) == 5 { // For object type result: tasks..results.. + // For object type step result: steps..results.. return subExpressions[1], subExpressions[3], nil, subExpressions[4], ParamTypeObject, nil } }