DevOps / Github Interview questions
What is the difference between repository-level and organization-level GitHub Actions secrets?
A repository-level secret is defined in a single repository's Settings > Secrets and variables > Actions and is only available to workflows running in that repository. An organization-level secret is defined once at the organization and can be made available to some or all repositories within it, without redefining the same value per repo.
| Repository secret | Organization secret |
| Scoped to one repository only. | Available to selected or all repositories in the organization. |
| Set and rotated independently per repository. | Set once; rotation applies everywhere it's shared. |
| Good for values genuinely unique to one repo. | Good for shared credentials used across many repositories. |
If a repository defines a secret with the same name as one it inherits from the organization, the repository-level value takes precedence for that repository's workflows, which lets an organization set a sensible shared default while still allowing individual repositories to override it when they genuinely need a different value.
More Related questions...