> ## Documentation Index
> Fetch the complete documentation index at: https://zenml.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Secrets Manager

> How to store secrets in GitHub

The GitHub secrets manager is a [secrets manager](/component-gallery/secrets-managers) flavor provided with the ZenML `github` integration that uses [GitHub secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to store secrets.

### When to use it

The GitHub secrets manager does not allow reading secret values unless it's running inside a GitHub Actions workflow. For this reason, this secrets manager **only** works in combination with a [GitHub Actions orchestrator](/component-gallery/orchestrators/github-actions).

### How to deploy it

GitHub secrets are automatically enabled when creating a GitHub repository.

### How to use it

To use the GitHub secrets manager, we need:

* The ZenML `github` integration installed. If you haven't done so, run

```
zenml integration install github  
```

* A personal access token to authenticate with the GitHub API. Follow [this guide](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to create one and make sure to give it the `repo` scope.

* Our GitHub username and the personal access token set as environment variables:

```
export GITHUB_USERNAME=  
export GITHUB_AUTHENTICATION_TOKEN=  
```

* The owner and name of the repository that we want to add secrets to.

We can then register the secrets manager and use it in our active stack:

```
zenml secrets-manager register  \
    --flavor=github \
    --owner= \
    --repository=

# Add the secrets manager to the active stack
zenml stack update -x 
```

You can now [register, update or delete secrets](/component-gallery/secrets-managers#in-the-cli) using the CLI or [fetch secret values inside your steps](/component-gallery/secrets-managers#in-a-zenml-step).

A concrete example of using the GitHub secrets manager can be found [here](https://github.com/zenml-io/zenml/tree/main/examples/github%5Factions%5Forchestration).

For more information and a full list of configurable attributes of the GitHub secrets manager, check out the [API Docs](https://apidocs.zenml.io/latest/integration%5Fcode%5Fdocs/integrations-github/#zenml.integrations.github.secrets%5Fmanagers.github%5Fsecrets%5Fmanager.GitHubSecretsManager).
