Expressions
Overview of expression syntax available in Workflows
Expressions use the ${{ }} syntax and are replaced with actual values at runtime. You can dynamically reference secrets, environment variables, built-in contexts, step outputs, and more.
Basic Syntax
# Expressions are written inside ${{ }}
env:
API_KEY: "${{ secrets.API_KEY }}"
BRANCH: "${{ collabops.ref_name }}"
VERSION: "${{ steps.version.outputs.app_version }}"Supported Locations
| Location | Supported | Example |
|---|---|---|
env value | ✅ | API_KEY: "${{ secrets.KEY }}" |
env key | ❌ | ${{ secrets.NAME }}: value (not allowed) |
with value | ✅ | ref: ${{ collabops.ref_name }} |
if condition | ✅ | if: "collabops.ref == 'refs/heads/main'" |
String in run | ✅ | run: echo ${{ collabops.sha }} |
Contexts Summary
| Context | Description | Details |
|---|---|---|
secrets | Secret values registered in the workspace/repository | Contexts |
vars | Organization/repository/environment variables | Contexts |
env | Environment variables defined in the workflow | Contexts |
collabops | Built-in context (ref, sha, actor, etc.) | Contexts |
steps | Step output references | Step Outputs |
inputs | Template input parameters (only available inside templates) | Workspace Templates |