Expressions and contexts

We've been using the ${{ }} syntax. Whatever we write inside the ${{ }} is called an expression. These expressions can be anything that needs to be evaluated, included literals like numbers, booleans, strings, and even operators (=, >, >=, <, <=).


Objects that contain some information about the workflow are called contexts. For example, the github context contains information about the GitHub repository, the secrets context contains all repository secrets. You can find all the contexts here.

GitHub comes with a list of functions for some basic operations. Expressions can be GitHub functions. You can find the complete list of available functions here.

Expressions and contexts 1

One group of GitHub functions that are particularly useful are the Job status functions. These return information on what the status of a job is (at the moment of their invocation). They are commonly used with the if key. This will cause the steps in the job (or a certain step) to only run if a certain expression evaluates to true (like, for example, a previous job being successful). GitHub will treat anything in the if key as an expression already, so we don't need to use the ${{ }} syntax.


The default Job check status is success() and it will be applied unless other functions are specified.

Expressions and contexts

You can find all Job status functions here.