Skip to content

Commit 91f9968

Browse files
authored
Update policies (#43013)
1 parent 5e6d77b commit 91f9968

File tree

3 files changed

+67
-26
lines changed

3 files changed

+67
-26
lines changed

.github/policies/auto-merge.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,46 @@ where:
88
configuration:
99
resourceManagementConfiguration:
1010
eventResponderTasks:
11-
- description: Approve and auto-squash-merge PRs to main labeled with 'auto-merge'
11+
- description: Approve and auto-squash-merge bot PRs to main labeled 'auto-merge'
1212
triggerOnOwnActions: true
1313
if:
14-
- payloadType: Pull_Request
15-
- labelAdded:
16-
label: ':octocat: auto-merge'
17-
- targetsBranch:
18-
branch: main
14+
- payloadType: Pull_Request
15+
- labelAdded:
16+
label: ':octocat: auto-merge'
17+
- targetsBranch:
18+
branch: main
19+
- or:
20+
- isActivitySender:
21+
user: azure-sdk
22+
- isActivitySender:
23+
user: dependabot
24+
- isActivitySender:
25+
user: dependabot[bot]
1926
then:
20-
- enableAutoMerge:
21-
mergeMethod: Squash
22-
- approvePullRequest:
23-
comment: "Approved; this PR will merge when all status checks pass."
27+
- enableAutoMerge:
28+
mergeMethod: Squash
29+
- approvePullRequest:
30+
comment: "Approved; this PR will merge when all status checks pass."
2431

25-
- description: Auto-merge PRs to live labeled with 'auto-merge'
32+
- description: Auto-merge policy service bot PRs to live labeled 'auto-merge'
2633
triggerOnOwnActions: true
2734
if:
28-
- payloadType: Pull_Request
29-
- labelAdded:
30-
label: ':octocat: auto-merge'
31-
- targetsBranch:
32-
branch: live
35+
- payloadType: Pull_Request
36+
- labelAdded:
37+
label: ':octocat: auto-merge'
38+
- targetsBranch:
39+
branch: live
40+
- isActivitySender:
41+
user: dotnet-policy-service[bot]
3342
then:
34-
- enableAutoMerge:
35-
mergeMethod: Merge
43+
- enableAutoMerge:
44+
mergeMethod: Merge
3645

3746
- description: Don't auto-merge PRs with 'auto-merge' label removed
3847
if:
39-
- payloadType: Pull_Request
40-
- labelRemoved:
41-
label: ':octocat: auto-merge'
48+
- payloadType: Pull_Request
49+
- labelRemoved:
50+
label: ':octocat: auto-merge'
4251
then:
43-
- disableAutoMerge
52+
- disableAutoMerge
4453

.github/policies/label-prs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ configuration:
6464
if:
6565
- payloadType: Pull_Request
6666
- or:
67-
- isActivitySender:
68-
user: dependabot
69-
- isActivitySender:
70-
user: dependabot[bot]
67+
- isActivitySender:
68+
user: dependabot
69+
- isActivitySender:
70+
user: dependabot[bot]
7171
then:
7272
- addLabel:
7373
label: ":octocat: auto-merge"

.github/policies/policy-edits.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
id:
2+
name: GitOps.PullRequestIssueManagement
3+
description: GitOps.PullRequestIssueManagement primitive
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: Flag PRs that change .github folder files.
12+
triggerOnOwnActions: true
13+
if:
14+
- payloadType: Pull_Request
15+
- isAction:
16+
action: Opened
17+
- filesMatchPattern:
18+
pattern: .github/*
19+
matchAny: true
20+
excludedFiles:
21+
- .github/CODEOWNERS
22+
- not:
23+
or:
24+
- activitySenderHasPermission:
25+
permission: admin
26+
- activitySenderHasPermission:
27+
permission: write
28+
then:
29+
- addReply:
30+
reply: >-
31+
@${issueAuthor} - This PR edits a file in the .github folder, which is not allowed. CC @dotnet/docs.
32+
- closePullRequest

0 commit comments

Comments
 (0)