What is an environment, and which protection rules can it have?
BeginnerConceptSecrets, Variables, Environments & Permissions
Answer
A named deployment target (dev, staging, prod) with its own secrets, variables and protection rules:
- Required reviewers: up to 6 users or teams, any one approval suffices; prevent self-review blocks the person who triggered the run.
- Wait timer: 1 to 43,200 minutes delay before the job starts.
- Deployment branches and tags: all, protected branches only, or selected patterns (
main,v*). - Custom deployment protection rules: GitHub Apps that approve or reject (change windows, monitoring health, ticket checks).
- Allow administrators to bypass toggle.
Protection rules on private repos require a paid plan.
More on Secrets, Variables, Environments & Permissions
Where can secrets be defined, and what is the precedence?BeginnerHow are secrets protected in transit and in logs, and what are the limits?IntermediateAre secrets available to every step automatically?BeginnerWhy is it a bad idea to store structured data like JSON or a whole `.env` file as one secret?IntermediateWhen does a job wait for environment approval, and what does the reviewer see?IntermediateHow do deployment branch policies interact with tags and `workflow_dispatch`?Advanced