Interview Prep/GitHub Actions/Secrets, OIDC & Environments

You want approvals only for prod but automatic deploys to dev and staging, with staging delayed 10 minutes for smoke checks. Configure.

BeginnerScenarioSecrets, OIDC & Environments
Answer

Situation read → Environment rules per stage.

What I'd do →

  1. dev: no rules, deployment branch main.
  2. staging: wait timer 10 minutes, deployment branch main.
  3. prod: required reviewers, prevent self-review, branches main and tags v*.
  4. Chain with needs: deploy-dev then needs: deploy-staging.

Why → Rules live in environments, so the workflow stays simple.

Interview tip → Wait timers do not consume runner minutes.

All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, OIDC & Environments