Reference
apex environment
Environments: the protection rules a workflow can only name
apex environment [command]Examples
The environments a repository protects, and how.
apex environment list acme/webRequire a named reviewer, and deploy only from main.
apex environment set acme/web production --reviewer user:octocat --branch-pattern mainSubcommands
apex environment list
Environments this repository protects, and how
apex environment list [options] <repository>With an API token, needs the permission environments:read.
| Argument | Description |
|---|---|
<repository> | owner/repo |
| Option | Description |
|---|---|
--json | machine-readable output |
apex environment set
Create or update an environment protection rule (repository admin)
apex environment set [options] <repository> <name>With an API token, needs the permission environments:write.
| Argument | Description |
|---|---|
<repository> | owner/repo |
<name> | environment name, as the workflow spells it |
| Option | Description |
|---|---|
--wait-timer <minutes> | delay before the job may start; 0 removes it |
--reviewer <who...> | user:<login>, role:<owner|account_admin|billing|member|viewer>, or a bare login (a user) |
--branch-pattern <glob...> | refs permitted to deploy here (main, releases/*, v?.0) |
--prevent-self-review | refuse an approval from whoever triggered the run |
--allow-self-review | permit it (the default) |
apex environment delete
Remove an environment protection rule (repository admin)
apex environment delete <repository> <name>With an API token, needs the permission environments:write.
| Argument | Description |
|---|---|
<repository> | owner/repo |
<name> | environment name |