Share once, use across many repos
If your org runs 30 repos that all need to deploy to AWS, copy-pasting the AWS keys into 30 sets of repo secrets is a maintenance and rotation nightmare. Organization secrets exist for exactly this case.
Set at: Org Settings → Secrets and variables → Actions → New organization secret. Then choose visibility:
- All repositories — every repo in the org sees it.
- Private repositories — only private/internal repos.
- Selected repositories — explicitly listed.
Resolution order
If both org and repo define a secret with the same name, the repo value wins. Useful for overriding org-level defaults in a single repo.
When to use which
- Org secret — credentials shared by many repos: cloud provider keys, registry tokens, common API keys.
- Repo secret — credentials specific to one project, or override of an org-level value.
- Environment secret — credentials tied to a deploy target (covered next lesson).