Secrets and environment variables
The Secrets and variables page is a place where you can control data that needs to be stored separately from the project source code, but still be accessible from the script.
Secrets
To increase the security of storing sensitive data, you can use secrets.
A secret is a key-value pair that contains data which should not be publicly accessible, such as passwords or access keys.
The values of secrets are encrypted.
How to add a secret
To add a secret:
- Open your project. On the Secrets and variables page, select Secrets > Add secret.
- Specify the name of the secret. It must be unique within the project.
- Specify the value of the secret. It will not be displayed in the interface after you save the secret.
- Click Add.
Click to edit the secret value or to delete it.
How to use a secret in the script
To access token values from the script, use the $secrets
built-in service.
Environment variables
A variable is an arbitrary key-value pair. Any piece of bot configuration which needs to be changed often without modifying the source code should be stored as a variable.
How to add a variable
To add a variable:
- Open your project. On the Secrets and variables page, select Environment variables > Add variable.
- Specify the name of the variable. The same restrictions as for secrets apply to variable names.
- Specify the value of the secret.
- Enable the Include into project export ZIP file checkbox if you want the variable to be saved when exporting the project as an archive.
- Click Add.
Click to edit the variable or to delete it.
How to use a variable in the script
To access variable values from the script, use the $env
built-in service.