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)
| 72 | // A complete expression has a "${{" marker that appears before a closing "}}" marker |
| 73 | // with at least one character between them. |
| 74 | func 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. |
| 84 | func isExpression(s string) bool { |
no outgoing calls