Skip to content

Commit f23c0f3

Browse files
authored
Prevent self reviews for secure deployments across Actions environments - [GA] (#44155)
1 parent 541d625 commit f23c0f3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Diff for: content/actions/deployment/targeting-different-environments/using-environments-for-deployment.md

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Third-party systems can be observability systems, change management systems, cod
5050

5151
Use required reviewers to require a specific person or team to approve workflow jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.
5252

53+
{% ifversion deployments-prevent-self-approval %}You also have the option to prevent self-reviews for deployments to protected environments. If you enable this setting, users who initiate a deployment cannot approve the deployment job, even if they are a required reviewer. This ensures that deployments to protected environments are always reviewed by more than one person.{% endif %}
54+
5355
For more information on reviewing jobs that reference an environment with required reviewers, see "[AUTOTITLE](/actions/managing-workflow-runs/reviewing-deployments)."
5456

5557
{% ifversion fpt %}{% note %}
@@ -190,6 +192,7 @@ Variables stored in an environment are only available to workflow jobs that refe
190192
1. Optionally, specify people or teams that must approve workflow jobs that use this environment. For more information, see "[Required reviewers](#required-reviewers)."
191193
1. Select **Required reviewers**.
192194
1. Enter up to 6 people or teams. Only one of the required reviewers needs to approve the job for it to proceed.
195+
{% ifversion deployments-prevent-self-approval %}1. Optionally, to prevent users from approving workflows runs that they triggered, select **Prevent self-review**.{% endif %}
193196
1. Click **Save protection rules**.
194197
1. Optionally, specify the amount of time to wait before allowing workflow jobs that use this environment to proceed. For more information, see "[Wait timer](#wait-timer)."
195198
1. Select **Wait timer**.

Diff for: content/actions/managing-workflow-runs/reviewing-deployments.md

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ For more information about environments and required approvals, see "[AUTOTITLE]
2626
- To approve the job, click **Approve and deploy**. Once a job is approved (and any other deployment protection rules have passed), the job will proceed. At this point, the job can access any secrets stored in the environment.
2727
- To reject the job, click **Reject**. If a job is rejected, the workflow will fail.
2828

29+
{% ifversion deployments-prevent-self-approval %}{% note %}
30+
31+
**Note:** If the targeted environment is configured to prevent self-approvals for deployments, you will not be able to approve a deployment from a workflow run you initiated. For more information, see "[AUTOTITLE](/actions/deployment/targeting-different-environments/using-environments-for-deployment#required-reviewers)."
32+
33+
{% endnote %}{% endif %}
34+
2935
{% ifversion actions-break-glass %}
3036

3137
## Bypassing deployment protection rules

Diff for: data/features/deployments-prevent-self-approval.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reference: #12088
2+
# Documentation for preventing self-review of deployments to protected environments
3+
versions:
4+
fpt: '*'
5+
ghec: '*'
6+
ghes: '>=3.11'

0 commit comments

Comments
 (0)