Skip to content

Secrets

Store credentials in your organization and make them available to Bash steps as environment variables.

A secret is a named set of keys and values stored in your organization, such as an API token for a preview service. A Bash step names the secrets it needs, and their keys become environment variables in the automation run.

Create secrets in your organization’s settings under Secrets, or with the CLI. For the CLI, describe the secret in a file:

apiVersion: v1
kind: Secret
metadata:
name: preview-service
spec:
provider: PROVIDER_LOCAL
local:
data:
PREVIEW_API_TOKEN: <your-token>
Terminal window
superplane secrets create -f preview-service.yaml

Keep the file out of Git.

List the secret under secrets in a Bash step. Each key in the secret becomes an environment variable:

steps:
- name: Publish a preview
secrets:
- preview-service
bash: npm run preview:publish

The publish script reads PREVIEW_API_TOKEN from the environment.

SuperPlane hides secret values in the automation run output.

  • Only Bash steps can name secrets.
  • Key names must be valid environment variable names. Two secrets in one automation can’t share a key.
  • A secret must exist before you apply an automation that names it.
  • Secrets belong to the organization, so every workspace can use them.
  • You need permission to create, update, or delete secrets.