Which operator is used in GitHub Actions expressions to check if a string contains a substring?
Select an answer to reveal the explanation.
Short Explanation and Infographic
GitHub Actions uses functions like contains(), not method chaining or SQL-style operators. It's a function-based expression language.
Full explanation below image
Full Explanation
GitHub Actions expressions use a set of built-in functions rather than object methods or SQL syntax. 'contains(search, item)' returns true if 'search' contains 'item' — works for strings and arrays. Other string functions: startsWith(search, item), endsWith(search, item). For arrays: contains(array, element). JavaScript-style '.includes()' method notation doesn't work in GitHub Actions expressions. The '~=' operator and 'LIKE' are from other languages/systems. Functions are case-insensitive: CONTAINS() and contains() both work.