Skip to content

Commit 5ebb1a0

Browse files
Merge pull request #3458 from gewarren/policy-test
Add policy to prevent public PRs to personalizer folder
2 parents f492987 + f53d262 commit 5ebb1a0

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

.github/policies/disallow-edits.yml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,58 @@ configuration:
1010
- payloadType: Pull_Request
1111
- isAction:
1212
action: Opened
13-
- or:
14-
- filesMatchPattern:
15-
matchAny: true
16-
pattern: articles/index.*
13+
- filesMatchPattern:
14+
matchAny: true
15+
pattern: articles/index.*
1716
then:
1817
- addReply:
1918
reply: >-
20-
@${issueAuthor} - You tried to add an index file to this repository; this is not permitted so your pull request will be closed automatically.
19+
@${issueAuthor} - You tried to add an index file to this repository; this is not permitted so your pull request will be closed automatically.
2120
- closePullRequest
21+
22+
- description: Close PRs to the "ai-services/personalizer" folder where the author isn't a member of the MicrosoftDocs org (i.e. PRs in public repo).
23+
if:
24+
- payloadType: Pull_Request
25+
- isAction:
26+
action: Opened
27+
- filesMatchPattern:
28+
matchAny: true
29+
pattern: articles/ai-services/personalizer/*
30+
- not:
31+
activitySenderHasAssociation:
32+
association: Member
33+
then:
34+
- addReply:
35+
reply: >-
36+
@${issueAuthor} - Pull requests that modify files in this folder aren't accepted from public contributors.
37+
- closePullRequest
38+
39+
- description: \@mention specific people when a PR is opened in the "ai-services/personalizer" folder.
40+
if:
41+
- payloadType: Pull_Request
42+
- isAction:
43+
action: Opened
44+
- filesMatchPattern:
45+
matchAny: true
46+
pattern: articles/ai-services/personalizer/*
47+
- activitySenderHasAssociation:
48+
association: Member
49+
- not:
50+
or:
51+
- isActivitySender:
52+
user: eric-urban
53+
- isActivitySender:
54+
user: nitinme
55+
- isActivitySender:
56+
user: mrbullwinkle
57+
then:
58+
- addReply:
59+
reply: >-
60+
@${issueAuthor} - Please don't sign off on this PR. The area owners will sign off once they've reviewed your contribution.
61+
- mentionUsers:
62+
mentionees:
63+
- eric-urban
64+
- nitinme
65+
- mrbullwinkle
66+
replyTemplate: ${mentionees} - Please review this PR and sign off when you're ready to merge it.
67+
assignMentionees: True # This part probably won't work since the bot doesn't have write perms.

0 commit comments

Comments
 (0)