Skip to content

Variables & Secrets

FlightStack supports environment variables and secrets for configuring builds without hardcoding sensitive values.

Plain-text key-value pairs for configuration:

  • Build modes
  • API endpoints
  • Feature flags

Encrypted values for sensitive data:

  • API keys
  • Signing credentials
  • Passwords

Variables and secrets can be defined at multiple levels:

ScopeInheritanceUse Case
OrganizationAll repos in orgShared API keys
RepositoryAll pipelines in repoRepo-specific config
PipelineSingle pipelinePipeline-specific values

More specific scopes override broader ones.

Reference variables in job configurations with double braces:

{{VARIABLE_NAME}}
Terminal window
echo "Building for $BUILD_MODE"
flutter build apk --$BUILD_MODE

Variables are exported as environment variables.

Build {{status}} for {{repositoryName}} on {{branch}}
https://api.example.com/webhook?token={{API_TOKEN}}

FlightStack provides built-in variables for every run:

VariableDescription
{{repositoryName}}Repository name
{{branch}}Branch being built
{{commit}}Full commit SHA
{{commitShort}}Short commit SHA (7 chars)
{{commitMessage}}Commit message
{{author}}Commit author
{{trigger}}Trigger type
{{status}}Job/run status
{{runNumber}}Pipeline run number
{{timestamp}}ISO timestamp
  1. Navigate to Settings (org, repo, or pipeline level)
  2. Go to Variables or Secrets tab
  3. Click Add Variable or Add Secret
  4. Enter key and value
  5. Save
VariableExampleUse
BUILD_MODEreleaseFlutter build mode
SLACK_WEBHOOKhttps://hooks...Notification URL
GOOGLE_PLAY_KEYJSON service accountAndroid deployment
APP_STORE_KEY_IDABC123XYZiOS deployment
SecretDescription
APP_STORE_CONNECT_API_KEYAPI key contents (p8 file)
APP_STORE_CONNECT_KEY_IDKey ID
APP_STORE_CONNECT_ISSUER_IDIssuer ID
DISTRIBUTION_CERTIFICATEBase64-encoded .p12
CERTIFICATE_PASSWORDP12 password
SecretDescription
KEYSTORE_FILEBase64-encoded keystore
KEYSTORE_PASSWORDKeystore password
KEY_ALIASKey alias
KEY_PASSWORDKey password
GOOGLE_PLAY_SERVICE_ACCOUNTJSON service account
  1. Never hardcode secrets - Always use the secrets system
  2. Use descriptive names - PROD_API_KEY not KEY1
  3. Scope appropriately - Don’t put repo-specific values at org level
  4. Rotate regularly - Update secrets periodically
  5. Audit access - Review who has access to secrets