From the course: Learning GitHub Actions

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Using secrets

Using secrets

- [Instructor] We've seen how we can add environment variables to workflows, but sometimes we need to store sensitive information like passwords or API keys. To do that, we need to use a secret. Unlike environment variables initialized in a workflow file, secrets are stored as encrypted values in your GitHub repositories settings. After a secret is stored, it can't be viewed or edited. To change a secret, you have to delete it and recreate it. Secrets also come with a few limits. Workflows are limited to 100 secrets and secrets are limited to 64 kilobytes in size. If you need to store secrets that are larger than 64 kilobytes, you can encrypt them as files, store them in the repository and then store the decryption key as a secret in the workflow. But if you don't want to deal with that kind of workaround, keep your secrets short and sweet. You can access secrets in your workflows using the secrets context in YAML…

Contents