Airlock
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

VariableDescriptionExample
AIRLOCK_RUN_IDUnique identifier for this Push Request runrun_abc123def456
AIRLOCK_BRANCHName of the branch being pushedfeature/add-auth
AIRLOCK_BASE_SHABase commit SHA (the merge base with the target branch)a1b2c3d4...
AIRLOCK_HEAD_SHAHead commit SHA (the latest commit being pushed)e5f6g7h8...
AIRLOCK_WORKTREEAbsolute path to the checked-out worktree for this run/Users/you/.airlock/worktrees/run_abc123
AIRLOCK_ARTIFACTSAbsolute path to the artifacts directory for this run/Users/you/.airlock/artifacts/run_abc123
AIRLOCK_REPO_ROOTAbsolute path to the original repository/Users/you/projects/my-app
AIRLOCK_UPSTREAM_URLURL of the upstream remotegit@github.com:you/my-app.git
AIRLOCK_FROZENSet 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"
fi
  • Custom Steps — Writing steps that use these variables
  • Freeze — How AIRLOCK_FROZEN is set