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 a secret
Section titled “Create a secret”Create secrets in your organization’s settings under Secrets, or with the CLI. For the CLI, describe the secret in a file:
apiVersion: v1kind: Secretmetadata: name: preview-servicespec: provider: PROVIDER_LOCAL local: data: PREVIEW_API_TOKEN: <your-token>superplane secrets create -f preview-service.yamlKeep the file out of Git.
Use a secret in a step
Section titled “Use a secret in a step”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:publishThe 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.