Skip to content

System Variables

RunnerHub automatically injects system variables into every pipeline execution. These variables provide information about the job, repository, trigger event, and execution environment.

VariableDescriptionExample
CIAlways set to true (standard CI indicator)true
RUNNERHUBAlways set to true (RunnerHub indicator)true
RUNNERHUB_JOB_IDUnique identifier for this jobjob_abc123def456
RUNNERHUB_WORKSPACE_IDID of the workspace this job belongs tows_xyz789
RUNNERHUB_APP_IDID of the app being builtapp_def456
RUNNERHUB_BRANCHBranch name where the event occurredmain, feature/auth
RUNNERHUB_COMMITFull commit hasha1b2c3d4e5f6g7h8i9j0
RUNNERHUB_REPO_URLRepository clone URLhttps://github.com/user/repo.git
RUNNERHUB_PLATFORMPlatform for this buildios, macos, android, flutter, react-native
RUNNERHUB_TRIGGERWhat triggered this jobpush, pull_request, manual, schedule
RUNNERHUB_PR_NUMBERPull request number (PR triggers only)42
RUNNERHUB_CLONE_DIRDirectory where repo is cloned/tmp/runnerhub/job_abc123/clone
RUNNERHUB_ARTIFACTS_DIRDirectory for job artifacts/tmp/runnerhub/job_abc123/artifacts
RH_PROVISIONING_PROFILE_NAMEProvisioning profile display name (auto-sign only)RunnerHub com.example.myapp appstore
RH_EXPORT_OPTIONS_PLISTAbsolute path to auto-generated ExportOptions.plist (auto-sign only)/tmp/runnerhub/job_abc123/ExportOptions.plist
HOMEHome directory (set to job directory)/tmp/runnerhub/job_abc123
TMPDIRTemporary directory (isolated to job)/tmp/runnerhub/job_abc123/tmp

Reference system variables in your pipeline steps like any other environment variable:

name: Job Info
platform: ios
environment:
xcode: "16.4"
steps:
- name: Print Job Info
run: |
echo "Job ID: $RUNNERHUB_JOB_ID"
echo "Branch: $RUNNERHUB_BRANCH"
echo "Commit: $RUNNERHUB_COMMIT"
echo "Trigger: $RUNNERHUB_TRIGGER"

Use commit hash and branch to create unique build versions:

name: Versioning
platform: ios
environment:
xcode: "16.4"
steps:
- name: Set Build Version
run: |
VERSION="1.0.0-${RUNNERHUB_BRANCH#*/}-${RUNNERHUB_COMMIT:0:8}"
echo "Building version: $VERSION"
xcodebuild -version

Execute different steps depending on how the pipeline was triggered:

name: Conditional Deploy
platform: ios
environment:
xcode: "16.4"
steps:
- name: Conditional Upload
run: |
if [ "$RUNNERHUB_TRIGGER" = "push" ] && [ "$RUNNERHUB_BRANCH" = "main" ]; then
echo "Running release upload..."
fastlane release
else
echo "Running dev upload..."
fastlane dev
fi

Only run certain steps on PR events:

name: PR Actions
platform: ios
environment:
xcode: "16.4"
steps:
- name: PR Comment
run: |
if [ -n "$RUNNERHUB_PR_NUMBER" ]; then
echo "This is PR #$RUNNERHUB_PR_NUMBER"
# Post comment, upload to review builds, etc.
fi

Organize artifacts in different directories based on the branch:

name: Organize Artifacts
platform: ios
environment:
xcode: "16.4"
steps:
- name: Organize Artifacts
run: |
mkdir -p $RUNNERHUB_ARTIFACTS_DIR/$RUNNERHUB_BRANCH
cp build/app.ipa $RUNNERHUB_ARTIFACTS_DIR/$RUNNERHUB_BRANCH/

Include job info in build logs for tracking and debugging:

name: Log Build Info
platform: ios
environment:
xcode: "16.4"
steps:
- name: Log Build Info
run: |
echo "=== Build Information ==="
echo "Job ID: $RUNNERHUB_JOB_ID"
echo "Workspace: $RUNNERHUB_WORKSPACE_ID"
echo "App: $RUNNERHUB_APP_ID"
echo "Branch: $RUNNERHUB_BRANCH"
echo "Commit: $RUNNERHUB_COMMIT"
echo "Repository: $RUNNERHUB_REPO_URL"
echo "Trigger: $RUNNERHUB_TRIGGER"
echo "========================"

Include job context in notifications to external services:

name: Slack Notification
platform: ios
environment:
xcode: "16.4"
variables:
SLACK_WEBHOOK: $SLACK_WEBHOOK
steps:
- name: Notify on Success
run: |
curl -X POST $SLACK_WEBHOOK \
-H 'Content-Type: application/json' \
-d "{
\"text\": \"Build $RUNNERHUB_JOB_ID succeeded\",
\"blocks\": [{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"Branch: *$RUNNERHUB_BRANCH*\nCommit: \`$RUNNERHUB_COMMIT\`\"
}
}]
}"

RunnerHub provides isolated directories for each job:

VariablePurpose
RUNNERHUB_CLONE_DIRDirectory where your repository is cloned
RUNNERHUB_ARTIFACTS_DIRDirectory for storing job outputs (build artifacts, logs, etc.)
TMPDIRTemporary directory isolated to this job
HOMEHome directory for the job environment

Steps execute from RUNNERHUB_CLONE_DIR by default. Use working_directory in your YAML to change this.

When automatic code signing is enabled for your app, RunnerHub additionally injects variables related to signing:

VariableDescriptionWhen Available
RH_PROVISIONING_PROFILE_NAMEThe display name of the provisioning profile (e.g., RunnerHub com.example.myapp appstore)When auto-sign creates or fetches a provisioning profile
RH_EXPORT_OPTIONS_PLISTAbsolute path to auto-generated ExportOptions.plist fileWhen auto-sign has both profile name and bundle identifier, and no existing ExportOptions.plist in the repository root

These variables are useful when building IPA archives for export:

name: Archive and Export
platform: ios
environment:
xcode: "16.4"
steps:
- name: Archive
run: |
xcodebuild archive \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-configuration Release \
-archivePath $PWD/build/MyApp.xcarchive \
-destination 'generic/platform=iOS'
- name: Export IPA
run: |
xcodebuild -exportArchive \
-archivePath $PWD/build/MyApp.xcarchive \
-exportPath $PWD/build \
-exportOptionsPlist $RH_EXPORT_OPTIONS_PLIST

See Code Signing Overview for more information about auto-signing.

ValueWhen Set
pushA commit was pushed to a branch (no open PR)
pull_requestA PR was opened, reopened, or updated
manualJob was triggered manually via the dashboard or API
scheduleJob was triggered by a scheduled timer

The RUNNERHUB_PR_NUMBER variable is:

  • Set when RUNNERHUB_TRIGGER is pull_request
  • Not set for push, manual, or schedule triggers
  • The numeric PR identifier (e.g., 42)

Check for its presence before using it:

name: PR Check
platform: ios
environment:
xcode: "16.4"
steps:
- name: PR-Only Step
run: |
if [ -z "$RUNNERHUB_PR_NUMBER" ]; then
echo "Not a PR, skipping PR-specific actions"
exit 0
fi
echo "This is PR #$RUNNERHUB_PR_NUMBER"

Your repository is cloned to RUNNERHUB_CLONE_DIR automatically before your steps run. Use this variable to reference the cloned directory. The git workspace is already authenticated, so you can run git commands directly:

name: Clone Submodules
platform: ios
environment:
xcode: "16.4"
steps:
- name: Clone Submodules
run: |
cd $RUNNERHUB_CLONE_DIR
git submodule update --init --recursive

The RUNNERHUB_REPO_URL contains the repository URL but does not include embedded authentication tokens. Authentication is handled internally by the agent during cloning.

  • System variables are injected automatically and cannot be overridden at the YAML or app level
  • Secrets referenced in your steps are masked in logs regardless of whether they’re stored in system variables
  • Repository authentication is handled internally by the agent; do not attempt to embed credentials in git commands