GitHub Actions Tutorial — Expressions
Chapter 7 — Expressions & Contexts
Expressions are the programming language of GitHub Actions. Written inside ${{ }}, they let you access context data, evaluate conditions, manipulate strings, and control workflow logic — all without writing a single line of shell script.
In this chapter, you’ll learn expression syntax, the context objects that power them, conditional execution, and built-in functions.
What You’ll Learn
- Expression syntax and operators
- Context objects:
github,env,secrets,needs,steps,matrix,runner - Conditional execution with
if: - Status check functions:
success(),failure(),always(),cancelled() - String and type functions
Topics Covered
1. Expression Syntax
Operators, literals, type coercion, and how expressions are evaluated.
2. Contexts
The data objects available inside expressions — github, env, steps, needs, matrix, and more.
3. Conditionals
Control which steps and jobs run with if: expressions.
4. Status Functions
React to job and step outcomes with success(), failure(), always(), and cancelled().
5. String Functions
Manipulate strings with contains(), startsWith(), endsWith(), format(), and more.
Practice
Test your understanding with hands-on exercises.
← Previous: Chapter 6: Environment & Secrets
Next: Chapter 8: Artifacts & Caching →