Skip to content

Commit

Permalink
Check author before auto-merging (#9961)
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren authored May 30, 2024
1 parent b4d3208 commit e9ca28a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
35 changes: 10 additions & 25 deletions .github/policies/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:

configuration:
resourceManagementConfiguration:
eventResponderTasks:
- if:
- description: Auto-squash-merge PRs to main labeled with auto-merge
triggerOnOwnActions: true
if:
- payloadType: Pull_Request

Check failure on line 11 in .github/policies/auto-merge.yml

View check run for this annotation

Dotnet Policy Service / GitOps/YmlValidation

.github/policies/auto-merge.yml#L11

No node deserializer was able to deserialize the node into type GitOps.PullRequestIssueManagement.Core.Primitives.Data.Actions.IfAction, GitOps.PullRequestIssueManagement.Core, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null
- labelAdded:
label: ':octocat: auto-merge'
Expand All @@ -17,9 +16,10 @@ configuration:
then:
- enableAutoMerge:
mergeMethod: Squash

- description: Auto-merge PRs to live labeled with auto-merge
triggerOnOwnActions: true
description: Auto-squash-merge PRs to main labeled with auto-merge
- if:
if:
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
Expand All @@ -28,26 +28,11 @@ configuration:
then:
- enableAutoMerge:
mergeMethod: Merge
triggerOnOwnActions: true
description: Auto-merge PRs to live labeled with auto-merge
- if:
- payloadType: Pull_Request
- isAction:
action: Opened
- titleContains:
pattern: Merge main into live
isRegex: False
- targetsBranch:
branch: live
then:
- enableAutoMerge:
mergeMethod: Merge
triggerOnOwnActions: true
description: Auto-merge PRs to live with title "Merge main into live"
- if:

- description: Don't auto-merge PRs with auto-merge label removed
if:
- payloadType: Pull_Request
- labelRemoved:
label: ':octocat: auto-merge'
then:
- disableAutoMerge
description: Don't auto-merge PRs with auto-merge label removed
7 changes: 4 additions & 3 deletions .github/policies/label-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ resource: repository
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- if:
- description: Label publish PRs with auto-merge
if:
- payloadType: Pull_Request

Check failure on line 10 in .github/policies/label-prs.yml

View check run for this annotation

Dotnet Policy Service / GitOps/YmlValidation

.github/policies/label-prs.yml#L10

No node deserializer was able to deserialize the node into type GitOps.PullRequestIssueManagement.Core.Primitives.Data.Actions.IfAction, GitOps.PullRequestIssueManagement.Core, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null
- isAction:
action: Opened
- isActivitySender:
user: dotnet-policy-service[bot]
- titleContains:
pattern: Merge main into live
isRegex: False
then:
- addLabel:
label: ':octocat: auto-merge'
description: Label main to live PRs
triggerOnOwnActions: true


0 comments on commit e9ca28a

Please sign in to comment.