Let’s Get Certified
Module 13 / 15 · Enterprise automation

Scope deployment credentials and ordinary configuration

Select an organization, repository or environment boundary, pass just the required secret and verify rotation without printing values.

Two environments, one key name

A workflow uses DEPLOY_KEY in test and production. Both environments have distinct service identities, but production must wait for a reviewer. Where should the values and the gate live?

Work through the decision

Set a different secret under each environment and bind each deployment job to the right environment. Configure required review for production. Give other jobs no access to those secrets. A shared organization variable is appropriate for a nonsecret region or feature flag.

Scope configuration to its audience

Store sensitive values as secrets and ordinary settings as variables. Use organization scope for selected shared repositories, repository scope for one project, and environment scope for deployment-specific values subject to protection. A more specific secret can override a same-named broader one.

Automate configuration without leaking values

Use vars for configuration and secrets for sensitive inputs at supported workflow keys. A composite action should receive its needed secret explicitly as an input or environment value. REST secret updates use the destination's public key and encrypted value. Secret values are not returned for later inspection.

For automation, the repository Actions public-key endpoint is GET /repos/{owner}/{repo}/actions/secrets/public-key. For a secret update send the encrypted value and key ID. Variables have their own CRUD endpoints and ordinary values. Keep the two payload formats separate.

Actions secrets REST API

Rotation without reading back a secret

An operator wants to rotate an Actions secret with a scheduled administrative process and prove the update succeeded. What evidence is both useful and safe?

Check your reasoning

Use the public key for the right destination, upload the encrypted replacement, check its update metadata and run a permitted consumer that reports only success. Keep the token and secret value out of logs. Listing secrets supplies names and metadata rather than plaintext.

GitHub documentation · GH-200 skills outline

Continue in GitHub Foundations. Separate identity, read access and merge authority.

Knowledge check

Scope deployment credentials and ordinary configuration quiz

Answer 5 questions. Check each answer for an explanation.