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

Function containsExpression

pkg/workflow/expression_patterns.go:74–81  ·  view source on GitHub ↗

containsExpression reports whether s contains a complete non-empty GitHub Actions expression. A complete expression has a "${{" marker that appears before a closing "}}" marker with at least one character between them.

(s string)

Source from the content-addressed store, hash-verified

72// A complete expression has a "${{" marker that appears before a closing "}}" marker
73// with at least one character between them.
74func containsExpression(s string) bool {
75 _, afterOpen, found := strings.Cut(s, "${{")
76 if !found {
77 return false
78 }
79 closeIdx := strings.Index(afterOpen, "}}")
80 return closeIdx > 0
81}
82
83// isExpression reports whether the entire string s is a GitHub Actions expression.
84func isExpression(s string) bool {

Callers 8

validateModelAliasMapMethod · 0.85
validateStringEnumFieldFunction · 0.85
validateTargetValueFunction · 0.85
TestExpressionHelpersFunction · 0.85
shellEscapeArgFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestExpressionHelpersFunction · 0.68