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

Add Resource Management automation for issue and PR Triage #1305

Merged
merged 4 commits into from
Dec 8, 2023
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
25 changes: 25 additions & 0 deletions .github/policies/labelManagement.issueOpened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
id: labelManagement.issueOpened
name: New Issues
description: Adds untriaged label to new issues
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Add untriaged to new issues
if:
- payloadType: Issues
- isAction:
action: Opened
then:
- addLabel:
label: untriaged
- description: Add CodeFlow link to new PRs
if:
- payloadType: Pull_Request
- isAction:
action: Opened
then:
- addCodeFlowLink
33 changes: 33 additions & 0 deletions .github/policies/labelManagement.issueUpdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
id: labelManagement.issueUpdated
name: Issue Activity Responder
description: Adds/Removes labels from issues based on activity
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Remove no-recent-activity label from issues after an update
if:
- or:
- payloadType: Issue_Comment
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: no-recent-activity
then:
- removeLabel:
label: no-recent-activity
- description: Remove needs-author-action label from issues when an author replies
if:
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: true
- hasLabel:
label: needs-author-action
then:
- removeLabel:
label: needs-author-action
48 changes: 48 additions & 0 deletions .github/policies/labelManagement.prUpdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
id: labelManagement.prUpdated
name: PR Activity Responder
description: Adds/Removes labels from PRs based on activity
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Add needs-author-action label when changes are requested
if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
- isReviewState:
reviewState: Changes_requested
then:
- addLabel:
label: needs-author-action
- description: Remove needs-author-action label from PRs when an author updates the PR
if:
- or:
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- not:
isAction:
action: Closed
- isActivitySender:
issueAuthor: true
- hasLabel:
label: needs-author-action
then:
- removeLabel:
label: needs-author-action
- description: Remove no-recent-activity label from PRs after an update
if:
- or:
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- not:
isAction:
action: Closed
- hasLabel:
label: no-recent-activity
then:
- removeLabel:
label: no-recent-activity
24 changes: 24 additions & 0 deletions .github/policies/scheduledSearch.closeStaleIssuesAndPrs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
id: scheduledSearch.closeStaleIssuesAndPrs
name: Close Stale Issues and PRs
description: Closes issues and PRs that have not been updated in a while
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Close issues and PRs that have not been updated in a while
frequencies:
- hourly:
hour: 12
filters:
- isOpen
- hasLabel:
label: needs-author-action
- hasLabel:
label: no-recent-activity
- noActivitySince:
days: 7
actions:
- closeIssue
30 changes: 30 additions & 0 deletions .github/policies/scheduledSearch.markNoRecentActivity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
id: scheduledSearch.markNoRecentActivity
name: No Recent Activity Monitor
description: Adds no-recent-activity label to issues and PRs that have not been updated in a while
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Add no-recent-activity label to issues and PRs that have not been updated in a while
frequencies:
- hourly:
hour: 3
filters:
- isOpen
- isNotLabeledWith:
label: no-recent-activity
- hasLabel:
label: needs-author-action
- noActivitySince:
days: 14
actions:
- addLabel:
label: no-recent-activity
- addReply:
reply: >-
This submission has been automatically marked as stale because it has been marked as requiring author action but has not had any activity for **14 days**.

It will be closed if no further activity occurs **within 7 days of this comment**.