extensions/.github/policies/resourceManagement.yml

227 строки
6.8 KiB
YAML

id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Close stale issues and pull requests
frequencies:
- hourly:
hour: 12
filters:
- isOpen
- hasLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
- hasLabel:
label: 'no-recent-activity :zzz:'
- noActivitySince:
days: 7
actions:
- closeIssue
- removeMilestone
- description: Add no recent activity label to issues and pull requests
frequencies:
- hourly:
hour: 3
filters:
- isOpen
- hasLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
- noActivitySince:
days: 14
- isNotLabeledWith:
label: 'no-recent-activity :zzz:'
actions:
- addLabel:
label: 'no-recent-activity :zzz:'
- addReply:
reply: >-
This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **14 days**.
It will be closed if no further activity occurs **within 7 days of this comment**.
eventResponderTasks:
- if:
- payloadType: Pull_Request
- isAction:
action: Opened
then:
- addCodeFlowLink
description: Add a CodeFlow link to new pull requests
- if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
- isReviewState:
reviewState: Changes_requested
then:
- addLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
description: Add needs author feedback label to pull requests when changes are requested
- if:
- payloadType: Pull_Request
- isActivitySender:
issueAuthor: True
- not:
isAction:
action: Closed
- hasLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
then:
- removeLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
description: Remove needs author feedback label when the author responds to a pull request
- if:
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
then:
- removeLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
description: Remove needs author feedback label when the author comments on a pull request
- if:
- payloadType: Pull_Request_Review
- isActivitySender:
issueAuthor: True
- hasLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
then:
- removeLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
description: Remove needs author feedback label when the author responds to a pull request review comment
- if:
- payloadType: Pull_Request
- not:
isAction:
action: Closed
- hasLabel:
label: 'no-recent-activity :zzz:'
then:
- removeLabel:
label: 'no-recent-activity :zzz:'
description: Remove no recent activity label from pull requests
- if:
- payloadType: Issue_Comment
- hasLabel:
label: 'no-recent-activity :zzz:'
then:
- removeLabel:
label: 'no-recent-activity :zzz:'
description: Remove no recent activity label when a pull request is commented on
- if:
- payloadType: Pull_Request_Review
- hasLabel:
label: 'no-recent-activity :zzz:'
then:
- removeLabel:
label: 'no-recent-activity :zzz:'
description: Remove no recent activity label when a pull request is reviewed
- if:
- payloadType: Pull_Request
- hasLabel:
label: 'automerge :octocat:'
then:
- enableAutoMerge:
mergeMethod: Squash
description: Automatically merge pull requests
- if:
- payloadType: Pull_Request
- labelRemoved:
label: 'automerge :octocat:'
then:
- disableAutoMerge
description: Automatically merge pull requests
- if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: 'work in progress :construction:'
description: In-PR label
- if:
- payloadType: Issue_Comment
then:
- cleanEmailReply
description: Cleanse emails
- if:
- payloadType: Pull_Request
then:
- assignTo:
author: True
description: Assign PRs to authors
- if:
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
then:
- removeLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
description: Remove needs author feedback label when the author comments on an issue
- if:
- payloadType: Issue_Comment
- hasLabel:
label: 'no-recent-activity :zzz:'
then:
- removeLabel:
label: 'no-recent-activity :zzz:'
description: Remove no recent activity label when an issue is commented on
- if:
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: 'no-recent-activity :zzz:'
then:
- removeLabel:
label: 'no-recent-activity :zzz:'
description: Remove no recent activity label from issue
- if:
- payloadType: Issues
- isAction:
action: Closed
then:
- removeMilestone
description: Remove closed issues from milestones
- if:
- payloadType: Pull_Request
- isAction:
action: Closed
then:
- removeLabel:
label: 'work in progress :construction:'
- removeLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
- removeLabel:
label: 'waiting-on-team :wave:'
description: Remove intermediate labels after PR is closed or merged
- if:
- payloadType: Issues
- or:
- isAction:
action: Closed
then:
- removeLabel:
label: untriaged
- removeLabel:
label: 'work in progress :construction:'
- removeLabel:
label: 'waiting-author-feedback :mailbox_with_no_mail:'
description: Remove intermediate labels from closed issue
onFailure:
onSuccess: