Naming your secrets
Conseil
To help ensure that GitHub redacts your secrets in logs correctly, avoid using structured data as the values of secrets.
The following rules apply to secret names:
- Peuvent uniquement contenir des caractères alphanumériques (
[a-z]
,[A-Z]
,[0-9]
) ou des traits de soulignement (_
). Les espaces ne sont pas autorisés. - Ne doit pas commencer par le préfixe
GITHUB_
. - Ne doit pas commencer par un chiffre.
- Ne sont pas sensibles à la casse lorsqu’ils sont référencés. GitHub enregistre les noms de secrets en majuscules, quelle que soit la façon dont ils sont entrés.
- Doivent être uniques au référentiel, à l’organisation ou à l’entreprise où ils sont créés.
S’il existe un secret du même nom à plusieurs niveaux, le secret au niveau le plus bas est prioritaire. Par exemple, si un secret au niveau de l’organisation porte le même nom qu’un secret au niveau du dépôt, celui-ci est prioritaire. Similarly, if an organization, repository, and environment all have a secret with the same name, the environment-level secret takes precedence.
Limits for secrets
You can store up to 1,000 organization secrets, 100 repository secrets, and 100 environment secrets.
A workflow created in a repository can access the following number of secrets:
- All 100 repository secrets.
- If the repository is assigned access to more than 100 organization secrets, the workflow can only use the first 100 organization secrets (sorted alphabetically by secret name).
- All 100 environment secrets.
Secrets are limited to 48 KB in size. To store larger secrets, see Using secrets in GitHub Actions.
When GitHub Actions reads secrets
Organization and repository secrets are read when a workflow run is queued, and environment secrets are read when a job referencing the environment starts.
Automatically redacted secrets
GitHub automatically redacts the following sensitive information from workflow logs.
Remarque
If you would like other types of sensitive information to be automatically redacted, please reach out to us in our community discussions.
- 32-byte and 64-byte Azure keys
- Azure AD client app passwords
- Azure Cache keys
- Azure Container Registry keys
- Azure Function host keys
- Azure Search keys
- Database connection strings
- HTTP Bearer token headers
- JWTs
- NPM author tokens
- NuGet API keys
- v1 GitHub installation tokens
- v2 GitHub installation tokens (
ghp
,gho
,ghu
,ghs
,ghr
) - v2 GitHub PATs
Security
For security best practices using secrets, see Secure use reference.