As seen in Context Variables, you can inject variables into the workflow by using the ${{ <context variable> }} syntax. Workflows support evaluating expressions as well such as comparisons and simple functions. For more information see the docs.
name:expressions-example
on:
push:
pull_request:
jobs:
use-expressions:
strategy:
matrix:
greeting:[Hello, Howdy, Hey]
runs-on:ubuntu-latest
steps:
-
name:Print if 'Hello'
Use equality operators to get a boolean result; in this case we are only running the step when the greeting is “Hello”. Note the use of single quotes for the string literal. You can use ==, !=, <, <=, >, >=, &&, ||, and ( ... ). Learn more about operators here