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
More on GitHub features, history rewriting and scale
What does a GitHub Actions workflow look like at a basic level?BeginnerWhat is a GitHub Release and how does it relate to a Git tag?BeginnerWhat are the permissions of `GITHUB_TOKEN` and how do you restrict them?IntermediateWhy do fork PRs get no secrets, and what is `pull_request_target`?AdvancedWhat is the difference between a GitHub fork and a clone?BeginnerWhat is a branch protection rule versus a ruleset?Intermediate