-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add behaviors for No-Recent-Activity * Add behaviors for when labels are added * Add behavior for assigning MSFT resource * Add behavior for cleaning up stale In-PR labels * Changed my mind on Blocking-Issue * Add comment triggers * Lint and add standard editor configs * Add triggers for issue open / close / update * Add recommended extensions * Set default encoding on powershell files * Add triggers for DSC Resource Labels * Final triggers * Spelling * Just doing what the bot says
- Loading branch information
Showing
20 changed files
with
1,118 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# top-most EditorConfig file | ||
root=true | ||
|
||
# Apply Windows-style newlines with a newline ending on every file, using UTF-8, and removing extra whitespace before newlines | ||
[*] | ||
end_of_line = crlf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
# Overrides for Yaml Files - Use two spaces for indents | ||
# editorconfig/editorconfig#329 | ||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Overrides for Markdown Files - Use tab for indents (accessibility) | ||
[*.md] | ||
indent_style = tab | ||
|
||
[{allow.txt,excludes.txt,patterns.txt}] | ||
end_of_line = lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.editorconfig text eol=crlf | ||
*.json text eol=crlf | ||
*.md text eol=crlf | ||
*.ps1 text eol=crlf | ||
*.txt text eol=crlf | ||
*.yml text=auto | ||
*.yaml text=auto | ||
.github/actions/spelling/** text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ VGpu | |
versioning | ||
worktree | ||
sortby | ||
msft | ||
automerge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
denelon | ||
Trenly | ||
ryfu | ||
stephengillie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
id: labelAdded.authorNotAuthorized | ||
name: GitOps.PullRequestIssueManagement | ||
description: Handlers when "Author-Not-Authorized" label is added | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: >- | ||
When the label "Author-Not-Authorized" is added to a pull request | ||
* Add the PR specific reply notifying the issue author | ||
* Label with Needs-Attention | ||
if: | ||
- payloadType: Pull_Request | ||
- labelAdded: | ||
label: Author-Not-Authorized | ||
then: | ||
- addReply: | ||
reply: >- | ||
${issueAuthor}, | ||
Changes to one or more files in your PR require authorization to modify. This PR has been assigned to our on call staff to evaluate. | ||
Template: msftbot/requiresApproval/MSFT | ||
- addLabel: | ||
label: Needs-Attention # This will automatically assign the ICM Users | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
onFailure: | ||
onSuccess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
id: labelAdded.changesRequested | ||
name: GitOps.PullRequestIssueManagement | ||
description: Handlers when "Changes-Requested" label is added | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: >- | ||
When the label "Changes-Requested" is added to a pull request | ||
* Add the PR specific reply notifying the issue author | ||
* Assign to the Author | ||
* Label with Needs-Author-Feedback | ||
if: | ||
- payloadType: Pull_Request | ||
- labelAdded: | ||
label: Changes-Requested | ||
then: | ||
- addReply: | ||
reply: >- | ||
Hello @${issueAuthor}, | ||
The package manager bot determined changes have been requested to your PR. | ||
Template: msftbot/changesRequested | ||
- assignTo: | ||
author: True | ||
- addLabel: | ||
label: Needs-Author-Feedback | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
onFailure: | ||
onSuccess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
id: labelAdded.needsCLA | ||
name: GitOps.PullRequestIssueManagement | ||
description: Handlers when "Needs-CLA" label is added | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: >- | ||
When the label "Needs-CLA" is added to a pull request | ||
* Add the PR specific reply notifying the issue they must sign the CLA | ||
if: | ||
- payloadType: Pull_Request | ||
- labelAdded: | ||
label: Needs-CLA | ||
then: | ||
- addReply: | ||
reply: >- | ||
Hello @${issueAuthor}, | ||
This PR cannot be merged until you sign the Contributor License Agreement (CLA). More information on this process can be found on the [Microsoft Open Source](https://opensource.microsoft.com/cla/) website. | ||
Template: msftbot/needsCLA | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
onFailure: | ||
onSuccess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
id: labelAdded.noRecentActivity | ||
name: GitOps.PullRequestIssueManagement | ||
description: Handlers when "No-Recent-Activity" label is added | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: >- | ||
When the label "No-Recent-Activity" is added to a pull request | ||
* Add the PR specific reply notifying the issue author of pending closure | ||
if: | ||
- payloadType: Pull_Request | ||
- labelAdded: | ||
label: No-Recent-Activity | ||
then: | ||
- addReply: | ||
reply: >- | ||
Hello @${issueAuthor}, | ||
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any recent activity. It will be closed if no further activity occurs **within 3 days of this comment**. | ||
Template: msftbot/noRecentActivity | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
- description: >- | ||
When the label "No-Recent-Activity" is added to an issue | ||
* Add the issue specific reply notifying the issue author of pending closure | ||
if: | ||
- payloadType: Issues | ||
- labelAdded: | ||
label: No-Recent-Activity | ||
then: | ||
- addReply: | ||
reply: >- | ||
Hello @${issueAuthor}, | ||
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any recent activity. It will be closed if no further activity occurs **within 3 days of this comment**. | ||
Template: msftbot/noRecentActivity | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
onFailure: | ||
onSuccess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
id: labelAdded.projectFile | ||
name: GitOps.PullRequestIssueManagement | ||
description: Handlers when "Project-File" label is added | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: >- | ||
When the label "Project-File" is added to a pull request | ||
* Add the PR specific reply notifying the issue author | ||
* Label with Needs-Attention | ||
if: | ||
- payloadType: Pull_Request | ||
- labelAdded: | ||
label: Project-File | ||
then: | ||
- addReply: | ||
reply: >- | ||
${issueAuthor}, | ||
Changes to one or more files in your PR require authorization to modify. This PR has been assigned to our on call staff to evaluate. | ||
Template: msftbot/requiresApproval/MSFT | ||
- addLabel: | ||
label: Needs-Attention # This will automatically assign the ICM Users | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
onFailure: | ||
onSuccess: |
37 changes: 37 additions & 0 deletions
37
.github/policies/labelManagement.assignIcmUsersAndModerators.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
id: labelAdded.assignIcmUsersAndModerators | ||
name: GitOps.PullRequestIssueManagement | ||
description: When these labels are added, the ICM Primary and secondary user should be assigned | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: >- | ||
When any label below is added to a PR | ||
* Assign the ICM users | ||
- if: | ||
- payloadType: Pull_Request | ||
- or: | ||
- labelAdded: | ||
label: Needs-Attention | ||
- labelAdded: | ||
label: Internal-Error | ||
- labelAdded: | ||
label: Author-Not-Authorized | ||
then: | ||
- assignTo: | ||
user: ryfu-msft | ||
# - assignIcmUsers: | ||
# teamId: 85579 | ||
# primary: True | ||
# secondary: False | ||
# - assignIcmUsers: | ||
# teamId: 85579 | ||
# primary: False | ||
# secondary: True | ||
# The policy service should trigger even when the label was added by the policy service | ||
triggerOnOwnActions: true | ||
onFailure: | ||
onSuccess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
id: labelManagement.issueClosed | ||
name: GitOps.PullRequestIssueManagement | ||
description: Handlers when an issue gets closed | ||
owner: | ||
resource: repository | ||
disabled: false | ||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
eventResponderTasks: | ||
- description: Remove labels when an issue is closed | ||
if: | ||
- payloadType: Issues | ||
- isAction: | ||
action: Closed | ||
then: | ||
- removeLabel: | ||
label: Needs-Triage | ||
- removeLabel: | ||
label: Needs-Attention | ||
- removeLabel: | ||
label: Needs-Author-Feedback | ||
- removeLabel: | ||
label: Help-Wanted | ||
## TODO: Unassign author | ||
- description: Remove labels when a pull request is closed | ||
if: | ||
- payloadType: Pull_Request | ||
- isAction: | ||
action: Closed | ||
then: | ||
- removeLabel: | ||
label: Needs-Attention | ||
- removeLabel: | ||
label: Needs-Author-Feedback | ||
## TODO: Unassign ICM Users | ||
onFailure: | ||
onSuccess: |
Oops, something went wrong.