Reference
Environment Variables
Environment variables available to workflow steps.
Every workflow step has access to these environment variables. They are set automatically by the Airlock daemon when executing a workflow.
Variable Reference
| Variable | Description | Example |
|---|---|---|
AIRLOCK_RUN_ID | Unique identifier for this Push Request run | run_abc123def456 |
AIRLOCK_BRANCH | Name of the branch being pushed | feature/add-auth |
AIRLOCK_BASE_SHA | Base commit SHA (the merge base with the target branch) | a1b2c3d4... |
AIRLOCK_HEAD_SHA | Head commit SHA (the latest commit being pushed) | e5f6g7h8... |
AIRLOCK_WORKTREE | Absolute path to the checked-out worktree for this run | /Users/you/.airlock/worktrees/run_abc123 |
AIRLOCK_ARTIFACTS | Absolute path to the artifacts directory for this run | /Users/you/.airlock/artifacts/run_abc123 |
AIRLOCK_REPO_ROOT | Absolute path to the original repository | /Users/you/projects/my-app |
AIRLOCK_UPSTREAM_URL | URL of the upstream remote | git@github.com:you/my-app.git |
AIRLOCK_FROZEN | Set to true after the freeze step runs. Unset before freeze. | true |
Usage in Steps
Shell commands (run)
Environment variables are available directly in shell commands:
- name: debug
run: |
echo "Running on branch: $AIRLOCK_BRANCH"
echo "Worktree at: $AIRLOCK_WORKTREE"
echo "Frozen: ${AIRLOCK_FROZEN:-false}"Custom steps (uses)
Custom step scripts have the same environment variables available:
#!/bin/bash
# Inside a custom step's run.sh
cd "$AIRLOCK_WORKTREE"
diff_stat=$(git diff --stat "$AIRLOCK_BASE_SHA" "$AIRLOCK_HEAD_SHA")
echo "Changes: $diff_stat"Checking Freeze Status
The AIRLOCK_FROZEN variable is only set after the freeze step runs. Before freeze, it is unset. Use a default value when checking:
if [ "${AIRLOCK_FROZEN:-false}" = "true" ]; then
echo "Worktree is frozen — read-only mode"
else
echo "Worktree is mutable — auto-fixes allowed"
fiRelated
- Custom Steps — Writing steps that use these variables
- Freeze — How
AIRLOCK_FROZENis set