Skip to content

Commit b09228a

Browse files
authored
Separate policy files (dotnet#9678)
1 parent 1e6666e commit b09228a

File tree

8 files changed

+790
-789
lines changed

8 files changed

+790
-789
lines changed

.github/policies/assign-prs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: GitOps.PullRequestIssueManagement
2+
description: Assign team-authored PRs to author
3+
resource: repository
4+
5+
configuration:
6+
resourceManagementConfiguration:
7+
eventResponderTasks:
8+
- if:
9+
- payloadType: Pull_Request
10+
- isAction:
11+
action: Opened
12+
- not:
13+
activitySenderHasPermission:
14+
permission: Read
15+
then:
16+
- assignTo:
17+
author: True
18+
description: Assign team PRs to author

.github/policies/author-action.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: GitOps.PullRequestIssueManagement
2+
description: Add and remove needs-author-action label to issues and PRs
3+
resource: repository
4+
5+
configuration:
6+
resourceManagementConfiguration:
7+
eventResponderTasks:
8+
- if:
9+
- payloadType: Issues
10+
- labelAdded:
11+
label: needs-author-action
12+
then:
13+
- addReply:
14+
reply: This issue has been marked `needs-author-action` and may be missing some important information.
15+
description: Needs-author-action notification
16+
- if:
17+
- payloadType: Pull_Request_Review
18+
- not:
19+
activitySenderHasPermission:
20+
permission: Read
21+
- isAction:
22+
action: Submitted
23+
- isReviewState:
24+
reviewState: Changes_requested
25+
then:
26+
- addLabel:
27+
label: needs-author-action
28+
description: PR reviews with "changes requested" applies the needs-author-action label
29+
- if:
30+
- payloadType: Issue_Comment
31+
- isAction:
32+
action: Created
33+
- isActivitySender:
34+
issueAuthor: True
35+
- hasLabel:
36+
label: needs-author-action
37+
- not:
38+
hasLabel:
39+
label: untriaged
40+
- isOpen
41+
then:
42+
- addLabel:
43+
label: needs-further-triage
44+
- removeLabel:
45+
label: needs-author-action
46+
description: Replace `needs-author-action` label with `needs-further-triage` label when the author comments on an issue that is not still untriaged
47+
- if:
48+
- payloadType: Issue_Comment
49+
- isAction:
50+
action: Created
51+
- isActivitySender:
52+
issueAuthor: True
53+
- hasLabel:
54+
label: needs-author-action
55+
- hasLabel:
56+
label: untriaged
57+
- isOpen
58+
then:
59+
- removeLabel:
60+
label: needs-author-action
61+
description: Remove `needs-author-action` label when the author comments on an `untriaged` issue
62+
- if:
63+
- payloadType: Pull_Request
64+
- isAction:
65+
action: Synchronize
66+
- hasLabel:
67+
label: needs-author-action
68+
then:
69+
- removeLabel:
70+
label: needs-author-action
71+
description: Pushing changes to PR branch removes the needs-author-action label
72+
- if:
73+
- payloadType: Issue_Comment
74+
- isActivitySender:
75+
issueAuthor: True
76+
- isAction:
77+
action: Created
78+
- hasLabel:
79+
label: needs-author-action
80+
- isOpen
81+
then:
82+
- removeLabel:
83+
label: needs-author-action
84+
description: Author commenting in PR removes the needs-author-action label
85+
- if:
86+
- payloadType: Pull_Request_Review
87+
- isActivitySender:
88+
issueAuthor: True
89+
- hasLabel:
90+
label: needs-author-action
91+
- isAction:
92+
action: Submitted
93+
- isOpen
94+
then:
95+
- removeLabel:
96+
label: needs-author-action
97+
description: Author responding to a pull request review comment removes the needs-author-action label
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: GitOps.PullRequestIssueManagement
2+
description: Label community PRs
3+
resource: repository
4+
5+
configuration:
6+
resourceManagementConfiguration:
7+
eventResponderTasks:
8+
- if:
9+
- payloadType: Pull_Request
10+
- isAction:
11+
action: Opened
12+
- and:
13+
- not:
14+
activitySenderHasPermission:
15+
permission: Admin
16+
- not:
17+
activitySenderHasPermission:
18+
permission: Write
19+
- not:
20+
activitySenderHasPermission:
21+
permission: Write
22+
- not:
23+
isActivitySender:
24+
user: github-actions[bot]
25+
issueAuthor: False
26+
- not:
27+
isActivitySender:
28+
user: dotnet-maestro[bot]
29+
issueAuthor: False
30+
- not:
31+
isActivitySender:
32+
user: dotnet-maestro-bot[bot]
33+
issueAuthor: False
34+
- not:
35+
isActivitySender:
36+
user: dotnet-maestro-bot
37+
issueAuthor: False
38+
- not:
39+
isActivitySender:
40+
user: dotnet-maestro
41+
issueAuthor: False
42+
- not:
43+
isActivitySender:
44+
user: github-actions
45+
issueAuthor: False
46+
then:
47+
- addLabel:
48+
label: community-contribution
49+
description: Label community PRs

0 commit comments

Comments
 (0)