Skip to content

Commit 414e3c4

Browse files
authored
repo sync
2 parents af03897 + 7ae7c88 commit 414e3c4

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

content/actions/reference/environments.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Environment protection rules and environment secrets are only available on publi
1919

2020
#### Environment protection rules
2121

22-
Environment protection rules require specific conditions to pass before a job referencing the environment can proceed. You can use environment protection rules to require a manual approval or to delay a job.
22+
Environment protection rules require specific conditions to pass before a job referencing the environment can proceed. You can use environment protection rules to require a manual approval, delay a job, or restrict the environment to certain branches.
2323

2424
##### Required reviewers
2525

@@ -31,6 +31,16 @@ For more information on reviewing jobs that reference an environment with requir
3131

3232
Use a wait timer to delay a job for a specific amount of time after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).
3333

34+
##### Deployment branches
35+
36+
Use deployment branches to restrict which branches can deploy to the environment. Below are the options for deployment branches for an environment:
37+
38+
* **All branches**: All branches in the repository can deploy to the environment.
39+
* **Protected branches**: Only branches with branch protection rules enabled can deploy to the environment. If no branch protection rules are defined for any branch in the repository, then all branches can deploy. For more information about branch protection rules, see "[About protected branches](/github/administering-a-repository/about-protected-branches)."
40+
* **Selected branches**: Only branches that match your specified name patterns can deploy to the environment.
41+
42+
For example, if you specify `releases/*` as a deployment branch rule, only branches whose name begins with `releases/` can deploy to the environment. (Wildcard characters will not match `/`. To match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.) If you add `main` as a deployment branch rule, a branch named `main` can also deploy to the environment. For more information about syntax options for deployment branches, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).
43+
3444
#### Environment secrets
3545

3646
Secrets stored in an environment are only available to workflow jobs that reference the environment. If the environment requires approval, a job cannot access environment secrets until one of the required reviewers approves it. For more information about secrets, see "[Encrypted secrets](/actions/reference/encrypted-secrets)."

0 commit comments

Comments
 (0)