Skip to content

Commit

Permalink
update policy yml
Browse files Browse the repository at this point in the history
  • Loading branch information
adegeo committed Aug 29, 2024
1 parent 7b8093a commit 1693125
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 143 deletions.
9 changes: 6 additions & 3 deletions .github/policies/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Auto-squash-merge PRs to main labeled with auto-merge
- description: Approve and auto-squash-merge PRs to main labeled with 'auto-merge'
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
Expand All @@ -19,8 +19,10 @@ configuration:
then:
- 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 PRs to live labeled with 'auto-merge'
triggerOnOwnActions: true
if:
- payloadType: Pull_Request
Expand All @@ -32,10 +34,11 @@ configuration:
- 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'
then:
- disableAutoMerge

21 changes: 21 additions & 0 deletions .github/policies/close-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Stale issues
description: Close needs-more-info issues that haven't had a response in 14 days
resource: repository
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- frequencies:
- daily:
time: 12:00
filters:
- isIssue
- isOpen
- hasLabel:
label: needs-more-info
- noActivitySince:
days: 14
actions:
- addReply:
reply: This issue has been automatically closed due to no response from the original author. Feel free to reopen it if you have more information that can help us investigate the issue further.
- closeIssue
117 changes: 63 additions & 54 deletions .github/policies/label-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,69 @@ resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Label doc-bug issues with okr-health (scheduled search)
frequencies:
- hourly:
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
resourceManagementConfiguration:
scheduledSearches:
- description: Label doc-bug issues with okr-quality (scheduled search)
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: doc-bug
- isNotLabeledWith:
label: okr-quality
actions:
- addLabel:
label: okr-quality

- description: Add in-pr label to issues
if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: in-pr
eventResponderTasks:
- 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
- description: Synchronize OKR and release labels from PRs to closing issues
if:
- payloadType: Pull_Request
then:
- labelSync:
pattern: okr-
- labelSync:
pattern: ":checkered_flag: Release"

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

- 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
168 changes: 87 additions & 81 deletions .github/policies/label-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,94 @@ where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Label community PRs
if:
- payloadType: Pull_Request
- 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:
- description: Label community PRs
if:
- payloadType: Pull_Request
- isAction:
action: Opened
- and:
- not:
activitySenderHasPermission:
permission: Admin
- not:
activitySenderHasPermission:
permission: Write
- not:
isActivitySender:
user: github-actions[bot]
- not:
isActivitySender:
user: github-actions
- not:
isActivitySender:
user: azure-sdk
- not:
isActivitySender:
user: dependabot
then:
- addLabel:
label: community-contribution

- 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"

- description: Label PRs from the Azure SDK bot
if:
- payloadType: Pull_Request
- isActivitySender:
user: azure-sdk
issueAuthor: False
- not:
isActivitySender:
user: dependabot
issueAuthor: False
then:
- addLabel:
label: community-contribution
then:
- addLabel:
label: ":octocat: auto-merge"

- description: Label publish PRs from 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'
- description: Label PRs from dependabot/dependabot[bot]
if:
- payloadType: Pull_Request
- or:
- isActivitySender:
user: dependabot
- isActivitySender:
user: dependabot[bot]
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-quality
if:
- payloadType: Pull_Request
- or:
- titleContains:
pattern: build warning
isRegex: False
- bodyContains:
pattern: build warning
isRegex: False
then:
- addLabel:
label: okr-quality

- 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
- 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
8 changes: 3 additions & 5 deletions .github/policies/scheduled-pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
name: GitOps.PullRequestIssueManagement - Scheduled PRs
description: Creates pull requests on a schedule
resource: repository
disabled: false

where:
configuration:
resourceManagementConfiguration:
Expand Down

0 comments on commit 1693125

Please sign in to comment.