Interview Prep/Git & GitHub/GitHub features, history rewriting and scale

What are GitHub environments and what protection do they offer?

IntermediateConceptGitHub features, history rewriting and scale
Answer

An environment (such as staging, production) groups deployment secrets and variables and can require reviewers, a wait timer and branch/tag restrictions before a job targeting it runs. A job opts in with environment: production, and the secrets only become available after approval.

jobs:
  deploy:
    environment: production
    runs-on: ubuntu-latest
All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub features, history rewriting and scale