Skip to content

Commit e9ca28a

Browse files
authored
Check author before auto-merging (#9961)
1 parent b4d3208 commit e9ca28a

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

.github/policies/auto-merge.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
id:
21
name: GitOps.PullRequestIssueManagement
32
description: GitOps.PullRequestIssueManagement primitive
4-
owner:
53
resource: repository
6-
disabled: false
7-
where:
4+
85
configuration:
96
resourceManagementConfiguration:
107
eventResponderTasks:
11-
- if:
8+
- description: Auto-squash-merge PRs to main labeled with auto-merge
9+
triggerOnOwnActions: true
10+
if:
1211
- payloadType: Pull_Request
1312
- labelAdded:
1413
label: ':octocat: auto-merge'
@@ -17,9 +16,10 @@ configuration:
1716
then:
1817
- enableAutoMerge:
1918
mergeMethod: Squash
19+
20+
- description: Auto-merge PRs to live labeled with auto-merge
2021
triggerOnOwnActions: true
21-
description: Auto-squash-merge PRs to main labeled with auto-merge
22-
- if:
22+
if:
2323
- payloadType: Pull_Request
2424
- labelAdded:
2525
label: ':octocat: auto-merge'
@@ -28,26 +28,11 @@ configuration:
2828
then:
2929
- enableAutoMerge:
3030
mergeMethod: Merge
31-
triggerOnOwnActions: true
32-
description: Auto-merge PRs to live labeled with auto-merge
33-
- if:
34-
- payloadType: Pull_Request
35-
- isAction:
36-
action: Opened
37-
- titleContains:
38-
pattern: Merge main into live
39-
isRegex: False
40-
- targetsBranch:
41-
branch: live
42-
then:
43-
- enableAutoMerge:
44-
mergeMethod: Merge
45-
triggerOnOwnActions: true
46-
description: Auto-merge PRs to live with title "Merge main into live"
47-
- if:
31+
32+
- description: Don't auto-merge PRs with auto-merge label removed
33+
if:
4834
- payloadType: Pull_Request
4935
- labelRemoved:
5036
label: ':octocat: auto-merge'
5137
then:
5238
- disableAutoMerge
53-
description: Don't auto-merge PRs with auto-merge label removed

.github/policies/label-prs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ resource: repository
55
configuration:
66
resourceManagementConfiguration:
77
eventResponderTasks:
8-
- if:
8+
- description: Label publish PRs with auto-merge
9+
if:
910
- payloadType: Pull_Request
1011
- isAction:
1112
action: Opened
13+
- isActivitySender:
14+
user: dotnet-policy-service[bot]
1215
- titleContains:
1316
pattern: Merge main into live
1417
isRegex: False
1518
then:
1619
- addLabel:
1720
label: ':octocat: auto-merge'
18-
description: Label main to live PRs
19-
triggerOnOwnActions: true
2021

2122

0 commit comments

Comments
 (0)