Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions .github/policies/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,46 @@ where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Approve and auto-squash-merge PRs to main labeled with 'auto-merge'
- description: Approve and auto-squash-merge bot PRs to main labeled 'auto-merge'
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
- targetsBranch:
branch: main
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
- targetsBranch:
branch: main
- or:
- isActivitySender:
user: azure-sdk
- isActivitySender:
user: dependabot
- isActivitySender:
user: dependabot[bot]
then:
- enableAutoMerge:
mergeMethod: Squash
- approvePullRequest:
comment: "Approved; this PR will merge when all status checks pass."
- enableAutoMerge:
mergeMethod: Squash
- approvePullRequest:
comment: "Approved; this PR will merge when all status checks pass."

- description: Auto-merge PRs to live labeled with 'auto-merge'
- description: Auto-merge policy service bot PRs to live labeled 'auto-merge'
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
- targetsBranch:
branch: live
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
- targetsBranch:
branch: live
- isActivitySender:
user: dotnet-policy-service[bot]
then:
- enableAutoMerge:
mergeMethod: Merge
- enableAutoMerge:
mergeMethod: Merge

- description: Don't auto-merge PRs with 'auto-merge' label removed
if:
- payloadType: Pull_Request
- labelRemoved:
label: ':octocat: auto-merge'
- payloadType: Pull_Request
- labelRemoved:
label: ':octocat: auto-merge'
then:
- disableAutoMerge
- disableAutoMerge

8 changes: 4 additions & 4 deletions .github/policies/label-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ configuration:
if:
- payloadType: Pull_Request
- or:
- isActivitySender:
user: dependabot
- isActivitySender:
user: dependabot[bot]
- isActivitySender:
user: dependabot
- isActivitySender:
user: dependabot[bot]
then:
- addLabel:
label: ":octocat: auto-merge"
Expand Down
32 changes: 32 additions & 0 deletions .github/policies/policy-edits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Flag PRs that change .github folder files.
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- isAction:
action: Opened
- filesMatchPattern:
pattern: .github/*
matchAny: true
excludedFiles:
- .github/CODEOWNERS
- not:
or:
- activitySenderHasPermission:
permission: admin
- activitySenderHasPermission:
permission: write
then:
- addReply:
reply: >-
@${issueAuthor} - This PR edits a file in the .github folder, which is not allowed. CC @dotnet/docs.
- closePullRequest
Loading