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
50 changes: 36 additions & 14 deletions .github/policies/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository

disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Auto-merge PRs to live labeled with auto-merge
- description: Approve and auto-squash-merge dependabot PRs to main labeled 'auto-merge'
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
- targetsBranch:
branch: main
- or:
- isActivitySender:
user: dotnet-policy-service[bot]
then:
- enableAutoMerge:
mergeMethod: Squash
- approvePullRequest:
comment: "Approved; this PR will merge when all status checks pass."

- 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
- 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
29 changes: 15 additions & 14 deletions .github/policies/label-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
resource: repository

where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Label publish PRs with auto-merge
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- 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 publish PRs from the dotnet-policy-service bot
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- isAction:
action: Opened
- isActivitySender:
user: dotnet-policy-service[bot]
- titleContains:
pattern: Merge main into live
isRegex: False
then:
- addLabel:
label: ":octocat: auto-merge"
42 changes: 29 additions & 13 deletions .github/policies/scheduled-pr.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
name: GitOps.PullRequestIssueManagement
description: Schedule a PR from main to live
name: GitOps.PullRequestIssueManagement - Scheduled PRs
description: Creates pull requests on a schedule
resource: repository

where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Push to live branch (publish)
frequencies:
- hourly:
hour: 3
filters: []
actions:
- createPullRequest:
head: main
base: live
title: Merge main into live
body: Please don't squash-merge this PR.
- description: Push to live branch (scheduled publish)
frequencies:
- daily:
time: 1:00
- daily:
time: 4:00
- daily:
time: 7:00
- daily:
time: 10:00
- daily:
time: 13:00
- daily:
time: 16:00
- daily:
time: 19:00
- daily:
time: 22:00
filters: []
actions:
- createPullRequest:
head: main
base: live
title: Merge main into live
body: Please don't squash-merge this PR.