Repository secret 'API_URL' is https://staging.example.com. Environment 'production' defines secret 'API_URL' as https://api.example.com. A job sets environment: production. Which value does secrets.API_URL resolve to?
Select an answer to reveal the explanation.
Short Explanation and Infographic
When a job targets an environment, environment secrets take precedence over repository secrets with the same name.
Full explanation below image
Full Explanation
Secret resolution order allows environment-scoped values to override repo-level secrets for jobs bound to that environment. Organization secrets have their own hierarchy and visibility rules. Duplicate names are allowed across levels; they do not concatenate. Use environments to separate staging vs production credentials safely. Jobs without environment: production would see the repository staging value. Document naming conventions so developers know which layer wins.