Secrets Management

Securely handle sensitive information in your workflows

CI/CD workflows often require access to sensitive information such as API keys, signing certificates, and deployment credentials. This guide explains how to securely manage these secrets in your workflow configurations.

Understanding Secrets in CI/CD

Secrets are sensitive values that should never be committed to your repository but are required for your CI/CD workflows. These include API keys, signing keys, access tokens, and other credentials.

Why Secrets Management Matters

  • Prevents exposure of sensitive information in your repository
  • Enables secure automation of deployment and distribution
  • Allows different team members to run workflows without sharing credentials
  • Supports different environments (development, staging, production)

GitHub Actions Secrets

GitHub Actions provides a secure way to store sensitive information as secrets

How GitHub Secrets Work

  • Secrets are encrypted environment variables stored in your GitHub repository
  • They are only exposed to selected GitHub Actions workflows
  • They are masked in logs (hidden from output)
  • They can be scoped to repositories, environments, or organizations

Setting Up Secrets in GitHub Actions

  1. Go to your GitHub repository
  2. Navigate to Settings → Secrets and variables → Actions
  3. Click "New repository secret"
  4. Enter the name and value for your secret
  5. Click "Add secret"

For more details, see the GitHub Actions encrypted secrets documentation.

Secret Naming Conventions

We recommend using a consistent naming convention for secrets:

  • ANDROID_KEYSTORE_BASE64: Android signing keystore (Base64 encoded)
  • ANDROID_KEYSTORE_PASSWORD: Android keystore password
  • ANDROID_KEY_ALIAS: Android signing key alias
  • ANDROID_KEY_PASSWORD: Android signing key password
  • IOS_DISTRIBUTION_CERT_BASE64: iOS distribution certificate (Base64 encoded)
  • IOS_PROVISIONING_PROFILE_BASE64: iOS provisioning profile (Base64 encoded)
  • IOS_CERT_PASSWORD: iOS certificate password

Bitrise Secrets

Bitrise provides multiple ways to securely manage sensitive information

How Bitrise Secrets Work

  • Secrets can be managed as Environment Variables with the "Sensitive" option enabled
  • Secrets are encrypted and masked in build logs
  • Secrets can be scoped to specific apps or workflows
  • Bitrise also offers Secrets management through the Secrets tab

Setting Up Secrets in Bitrise

  1. Log in to your Bitrise account
  2. Navigate to your app
  3. Go to Workflow Editor → Secrets tab
  4. Click "Add new" and enter the key and value for your secret
  5. Toggle "Expose for Pull Requests" only if needed (usually keep this off for sensitive values)
  6. Click "Add new secret"

Alternatively, you can add secrets as Environment Variables:

  1. Go to Workflow Editor → Env Vars tab
  2. Click "Add new"
  3. Enter the key and value
  4. Check "Make sensitive" to secure the value
  5. Click "Add new env var"

For more details, see the Bitrise secrets documentation.

Required Secrets by Context

Different workflow configurations require different sets of secrets

Storage Provider Secrets

ProviderRequired SecretsDescription
GitHub ArtifactsNoneUses GITHUB_TOKEN automatically
Firebase App DistributionFIREBASE_APP_IDYour Firebase App ID
FIREBASE_TOKENFirebase CLI authentication token
Google DriveGOOGLE_DRIVE_CLIENT_IDOAuth client ID
GOOGLE_DRIVE_CLIENT_SECRETOAuth client secret
GOOGLE_DRIVE_REFRESH_TOKENOAuth refresh token
Amazon S3AWS_ACCESS_KEY_IDAWS access key with S3 permissions
AWS_SECRET_ACCESS_KEYCorresponding AWS secret key
AWS_BUCKET_NAMETarget S3 bucket name

Platform-Specific Secrets

PlatformRequired SecretsDescription
AndroidANDROID_KEYSTORE_BASE64Base64-encoded keystore file
ANDROID_KEYSTORE_PASSWORDPassword for the keystore file
ANDROID_KEY_ALIASAlias of the key in the keystore
ANDROID_KEY_PASSWORDPassword for the specific key
iOSIOS_DISTRIBUTION_CERT_BASE64Base64-encoded distribution certificate
IOS_PROVISIONING_PROFILE_BASE64Base64-encoded provisioning profile
IOS_CERT_PASSWORDCertificate password

Notification Secrets

Notification TypeRequired SecretsDescription
SlackSLACK_WEBHOOK_URLWebhook URL for posting to Slack channel
TeamsTEAMS_WEBHOOK_URLWebhook URL for posting to Teams channel