Skip to content

Commit

Permalink
adjusting policies to prevent invalid states (#2242)
Browse files Browse the repository at this point in the history
* adjusting policies to prevent invalid states

* removing auto-merge workflow
  • Loading branch information
mattchenderson authored Mar 5, 2024
1 parent c720ff9 commit 48a78e3
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 46 deletions.
3 changes: 1 addition & 2 deletions .github/policies/issue.add-no-recent-activity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ configuration:
- addLabel:
label: no-recent-activity
- addReply:
reply: >-
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 **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
If you are not the original author (${issueAuthor}) and believe this issue is not stale, please comment with `/bot not-stale` and I will not close it.
onFailure:
onSuccess:
24 changes: 0 additions & 24 deletions .github/policies/issue.assign.yml

This file was deleted.

35 changes: 34 additions & 1 deletion .github/policies/issue.flag-for-triage.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Flag for triage
description: Add needs triage label to new issues
description: Add triage labels and default assignments to issues
resource: repository
configuration:
resourceManagementConfiguration:
eventResponderTasks:

- description: Add needs triage label to new issues
if:
- payloadType: Issues
Expand All @@ -15,5 +16,37 @@ configuration:
then:
- addLabel:
label: 'Needs: Triage (Functions)'

- description: Add needs attention label to reopened issues
if:
- payloadType: Issues
- and:
- isAction:
action: Reopened
- not:
hasLabel: 'Needs: Attention :wave:'
then:
- addLabel:
label: 'Needs: Attention :wave:'

- description: Assign issues when marked for triage or when attention needed again
if:
- payloadType: Issues
- isAction:
action: Labeled
- not:
isAssignedToSomeone
- or:
- labelAdded:
label: 'Needs: Triage (Functions)'
- labelAdded:
label: 'Needs: Attention :wave:'
then:
- assignIcmUsers:
teamId: 114785
primary: true
secondary: false
triggerOnOwnActions: true

onFailure:
onSuccess:
7 changes: 7 additions & 0 deletions .github/policies/issue.prevent-auto-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ configuration:
- description: Prevents issue from being closed by the automation
if:
- payloadType: Issue_Comment
- or :
- isAction:
action: Created
- isAction:
action: Edited
- commentContains:
pattern: /bot not-stale
isRegex: False
Expand All @@ -15,6 +20,8 @@ configuration:
label: 'Needs: Author Feedback'
- hasLabel:
label: no-recent-activity
- not:
hasLabel: 'bot: do not close'
then:
- addLabel:
label: 'bot: do not close'
Expand Down
7 changes: 5 additions & 2 deletions .github/policies/issue.remove-needs-author-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ configuration:
- hasLabel:
label: 'Needs: Author Feedback'
then:
- addLabel:
label: 'Needs: Attention :wave:'
- if:
- isOpen
then:
- addLabel:
label: 'Needs: Attention :wave:'
- removeLabel:
label: 'Needs: Author Feedback'
onFailure:
Expand Down
31 changes: 29 additions & 2 deletions .github/policies/issue.remove-needs-triage.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Remove needs triage label
description: Removes the needs triage label from closed issues
name: Remove triage labels on close
description: Removes "needs:*" labels from closed issues
resource: repository
configuration:
resourceManagementConfiguration:
eventResponderTasks:

- description: Remove needs triage label from closed issues
if:
- payloadType: Issues
Expand All @@ -14,5 +15,31 @@ configuration:
then:
- removeLabel:
label: 'Needs: Triage (Functions)'
triggerOnOwnActions: true

- description: Remove needs attention label from closed issues
if:
- payloadType: Issues
- isAction:
action: Closed
- hasLabel:
label: 'Needs: Attention :wave:'
then:
- removeLabel:
label: 'Needs: Attention :wave:'
triggerOnOwnActions: true

- description: Remove needs author feedback label from closed issues
if:
- payloadType: Issues
- isAction:
action: Closed
- hasLabel:
label: 'Needs: Author Feedback'
then:
- removeLabel:
label: 'Needs: Author Feedback'
triggerOnOwnActions: true

onFailure:
onSuccess:
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ configuration:
- description: Remove no recent activity label when issue is commented on
if:
- payloadType: Issue_Comment
- isAction:
action: Created
- hasLabel:
label: no-recent-activity
then:
Expand Down
15 changes: 0 additions & 15 deletions .github/policies/pullrequest.all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,6 @@ configuration:
- removeLabel:
label: no-recent-activity
description:
- if:
- payloadType: Pull_Request
- hasLabel:
label: AutoMerge
then:
- enableAutoMerge:
mergeMethod: Squash
description:
- if:
- payloadType: Pull_Request
- labelRemoved:
label: AutoMerge
then:
- disableAutoMerge
description:
- if:
- payloadType: Pull_Request
- isOpen
Expand Down

0 comments on commit 48a78e3

Please sign in to comment.