MCPcopy Create free account
hub / github.com/github/gh-aw / stripExpressionWrapper

Function stripExpressionWrapper

pkg/workflow/expression_parser.go:16–25  ·  view source on GitHub ↗

stripExpressionWrapper removes the ${{ }} wrapper from an expression if present

(expression string)

Source from the content-addressed store, hash-verified

14
15// stripExpressionWrapper removes the ${{ }} wrapper from an expression if present
16func stripExpressionWrapper(expression string) string {
17 // Trim whitespace
18 expr := strings.TrimSpace(expression)
19 // Check if it starts with ${{ and ends with }}
20 if strings.HasPrefix(expr, "${{") && strings.HasSuffix(expr, "}}") {
21 // Remove the wrapper and trim inner whitespace
22 return strings.TrimSpace(expr[3 : len(expr)-2])
23 }
24 return expr
25}
26
27// ExpressionParser handles parsing of expression strings into ConditionNode trees
28type ExpressionParser struct {

Callers 6

combineTokenExpressionsFunction · 0.85
buildMainJobMethod · 0.85
extractIfConditionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected