Which two expressions correctly evaluate string checks commonly used in job if: conditions? (Choose two.)
Select all correct answers, then click Submit.
Short Explanation and Infographic
Actions expressions ship contains() and startsWith() (and endsWith) for string checks in if: conditions. They are not JavaScript method calls or Perl =~ operators inside ${{ }}.
Full explanation below image
Full Explanation
The GitHub Actions expression language provides functions such as contains, startsWith, endsWith, format, toJSON, fromJSON, success, failure, always, and cancelled. contains(github.ref, 'main') is true when the ref string includes that substring—useful but be aware that branch names like 'mainline' also match. startsWith(github.ref, 'refs/tags/') is a robust tag gate. Arbitrary JavaScript like .includes is not executed inside ${{ }}. There is no Perl-style ~= regex operator in the expression language; for complex matching, compute a flag in a prior step or use supported functions carefully. Always quote and parenthesize conditions clearly, and prefer github.ref_name or event payload fields when they better express intent.