Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update policies #1831

Merged
merged 6 commits into from
May 31, 2024
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
41 changes: 41 additions & 0 deletions .github/policies/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Auto-squash-merge PRs to main labeled with auto-merge
triggerOnOwnActions: true
if:
- payloadType: Pull_Request

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

View check run for this annotation

Dotnet Policy Service / GitOps/YmlValidation

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

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'
- targetsBranch:
branch: main
then:
- enableAutoMerge:
mergeMethod: Squash

- description: Auto-merge PRs to live labeled with auto-merge
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
- labelAdded:
label: ':octocat: auto-merge'
- targetsBranch:
branch: live
then:
- enableAutoMerge:
mergeMethod: Merge

- description: Don't auto-merge PRs with auto-merge label removed
if:
- payloadType: Pull_Request
- labelRemoved:
label: ':octocat: auto-merge'
then:
- disableAutoMerge
23 changes: 0 additions & 23 deletions .github/policies/good-first-issue.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/policies/label-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Label doc-bug issues with okr-health (scheduled search)
frequencies:
- hourly:

Check failure on line 13 in .github/policies/label-issues.yml

View check run for this annotation

Dotnet Policy Service / GitOps/YmlValidation

.github/policies/label-issues.yml#L13

Exception during deserialization. Failed to create an instance of type 'GitOps.PullRequestIssueManagement.Core.Primitives.Data.Frequencies.SearchFrequency'.. Cannot dynamically create an instance of type 'GitOps.PullRequestIssueManagement.Core.Primitives.Data.Frequencies.SearchFrequency'. Reason: Cannot create an abstract class.
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: doc-bug
- isNotLabeledWith:
label: okr-health
actions:
- addLabel:
label: okr-health

eventResponderTasks:
- description: Label issues with okr-health (event-based)
if:
- payloadType: Issues
- or:
- hasLabel:
label: doc-bug
- titleContains:
pattern: freshness
isRegex: False
- titleContains:
pattern: out( |-)of( |-)date
isRegex: True
then:
- addLabel:
label: okr-health

- description: Add in-pr label to issues
if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: in-pr

- description: Label typo issues
if:
- payloadType: Issues
- isAction:
action: Opened
- titleContains:
pattern: (T|t)ypo
isRegex: True
then:
- addLabel:
label: doc-bug
- addLabel:
label: help wanted
- addLabel:
label: good first issue

94 changes: 94 additions & 0 deletions .github/policies/label-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Label community PRs
if:
- payloadType: Pull_Request

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

View check run for this annotation

Dotnet Policy Service / GitOps/YmlValidation

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

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
- and:
- not:
activitySenderHasPermission:
permission: Admin
- not:
activitySenderHasPermission:
permission: Write
- not:
isActivitySender:
user: github-actions[bot]
issueAuthor: False
- not:
isActivitySender:
user: github-actions
issueAuthor: False
- not:
isActivitySender:
user: azure-sdk
issueAuthor: False
- not:
isActivitySender:
user: dependabot
issueAuthor: False
then:
- addLabel:
label: community-contribution

- description: Label publish PRs from dotnet-policy-service bot
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 PRs from the Azure SDK bot
if:
- payloadType: Pull_Request
- isActivitySender:
user: azure-sdk
then:
- approvePullRequest:
comment: "Approved; this PR will merge when all status checks pass."
- addLabel:
label: ':octocat: auto-merge'

- description: Label PRs with okr-health
if:
- payloadType: Pull_Request
- or:
- titleContains:
pattern: build warning
isRegex: False
- bodyContains:
pattern: build warning
isRegex: False
then:
- addLabel:
label: okr-health

- description: Label PRs with okr-freshness
if:
- payloadType: Pull_Request
- or:
- titleContains:
pattern: freshness
isRegex: False
- bodyContains:
pattern: freshness
isRegex: False
then:
- addLabel:
label: okr-freshness
129 changes: 0 additions & 129 deletions .github/policies/resourceManagement.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/policies/scheduled-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Push to live branch (scheduled publish)
frequencies:
- daily:

Check failure on line 13 in .github/policies/scheduled-pr.yml

View check run for this annotation

Dotnet Policy Service / GitOps/YmlValidation

.github/policies/scheduled-pr.yml#L13

Exception during deserialization. Failed to create an instance of type 'GitOps.PullRequestIssueManagement.Core.Primitives.Data.Frequencies.SearchFrequency'.. Cannot dynamically create an instance of type 'GitOps.PullRequestIssueManagement.Core.Primitives.Data.Frequencies.SearchFrequency'. Reason: Cannot create an abstract class.
time: 08:0
filters: []
actions:
- createPullRequest:
head: main
base: live
title: Merge main into live
body: Please don't squash-merge this PR.
Loading