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
38 changes: 38 additions & 0 deletions .github/policies/labelAdded.noRecentActivity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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 an issue
* Add a reply notifying the issue author of pending closure
if:
- payloadType: Issues
- labelAdded:
label: No-Recent-Activity
then:
- addReply:
reply: >-
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
# 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 a pull request
* Add a reply notifying the PR author of pending closure
if:
- payloadType: Pull_Request
- labelAdded:
label: No-Recent-Activity
then:
- addReply:
reply: >-
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
onFailure:
onSuccess:
28 changes: 28 additions & 0 deletions .github/policies/labelManagement.issueClosed.yml
Comment thread
denelon marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: labelManagement.issueClosed
name: GitOps.PullRequestIssueManagement
description: Handlers when an issue or pull request gets closed
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Remove labels when an issue or pull request is closed
if:
- or:
- payloadType: Issues
- payloadType: Pull_Request
- isAction:
action: Closed
then:
- removeLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Attention
- removeLabel:
label: Needs-Author-Feedback
- removeLabel:
label: Help-Wanted
onFailure:
onSuccess:
50 changes: 50 additions & 0 deletions .github/policies/labelManagement.issueOpened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
id: labelManagement.issueOpened
name: GitOps.PullRequestIssueManagement
description: Handlers for when an issue is first opened
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Add Needs-Triage to new issues
if:
- payloadType: Issues
- isAction:
action: Opened
then:
- addLabel:
label: Needs-Triage
- description: Add CodeFlow link to new PRs
if:
- payloadType: Pull_Request
- isAction:
action: Opened
then:
- addCodeFlowLink
- description: >-
Close issues with empty body on open or reopen
* Close the issue
* Add Needs-Author-Feedback label
* Add a reply notifying the author
if:
- payloadType: Issues
- or:
- isAction:
action: Opened
- isAction:
action: Reopened
- or:
- not:
bodyContains:
pattern: .+
isRegex: True
then:
- closeIssue
- addLabel:
label: Needs-Author-Feedback
- addReply:
reply: "Hi! Thanks for attempting to open an issue. Unfortunately, you didn't write anything in the body which makes it impossible to understand your concern. You are welcome to fix up the issue and try again by opening another issue with the body filled out. "
onFailure:
onSuccess:
100 changes: 100 additions & 0 deletions .github/policies/labelManagement.issueUpdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
id: labelManagement.issueUpdated
name: GitOps.PullRequestIssueManagement
description: >-
Handlers for when an issue is updated and not closed.
This primarily includes handlers for comments, reviews, and re-runs.
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Remove "No-Recent-Activity" when a pull request or issue is updated
if:
- or:
- payloadType: Pull_Request
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- payloadType: Issue_Comment
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
# The policy service should not trigger itself here, or else the label would be removed immediately after being added
triggerOnOwnActions: False
- description: Clean email replies on every comment
if:
- or:
- payloadType: Issue_Comment
- payloadType: Pull_Request_Review_Comment
then:
- cleanEmailReply
- description: Remove "Help-Wanted" label when an issue goes into PR
if:
- payloadType: Issues
- labelAdded:
label: In-PR
- hasLabel:
label: Help-Wanted
then:
- removeLabel:
label: Help-Wanted
- description: >-
If an author responds to an issue which needs author feedback
* Remove the Needs-Author-Feedback Label
* Add the Needs-Attention Label
if:
- or:
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: Needs-Author-Feedback
- not:
isAction:
action: Synchronize
then:
- removeLabel:
label: Needs-Author-Feedback
- addLabel:
label: Needs-Attention
- description: >-
When changes are requested on a pull request
* Label with Needs-Author-Feedback
if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
- isReviewState:
reviewState: Changes_requested
then:
- addLabel:
label: Needs-Author-Feedback
- description: Sync labels from issues on all pull request events
if:
- payloadType: Pull_Request
then:
- labelSync:
pattern: Issue-
- labelSync:
pattern: Area-
- labelSync:
pattern: Priority-
- labelSync:
pattern: Product-
- labelSync:
pattern: Severity-
- labelSync:
pattern: Impact-
- inPrLabel:
label: In-PR
onFailure:
onSuccess:
60 changes: 60 additions & 0 deletions .github/policies/moderatorTriggers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
id: moderatorTriggers
name: GitOps.PullRequestIssueManagement
description: Handlers for moderator comment triggers
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When a moderator comments with specific trigger patterns
if:
- or:
- payloadType: Issue_Comment
- payloadType: Pull_Request_Review_Comment
- or:
- activitySenderHasPermission:
permission: Admin
- activitySenderHasPermission:
permission: Write
then:
# Duplicate of #
- if:
- commentContains:
pattern: '(?in)Duplicate\s+of\s+\#?\s*\d+'
isRegex: True
then:
- addReply:
reply: >-
Hi! We've identified this issue as a duplicate of another one that already
exists on this Issue Tracker. This specific instance is being closed in favor
of tracking the concern over on the referenced thread. Be sure to add your
πŸ‘ to that issue. Thanks for your report!
- closeIssue
- removeLabel:
label: Needs-Triage
- addLabel:
label: Resolution-Duplicate
- removeLabel:
label: Needs-Author-Feedback
# /feedback
- if:
- commentContains:
pattern: '\/feedback'
isRegex: True
then:
- addReply:
reply: >-
Hi there!


Can you please send us feedback with the Feedback Hub with this issue and paste the link here so we can more easily find your crash information on the back end?


Thanks!
- addLabel:
label: Needs-Author-Feedback
onFailure:
onSuccess:
Loading