Skip to content

Commit b3fd68e

Browse files
committed
split into two policies
1 parent 697c982 commit b3fd68e

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/policies/disallow-edits.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,21 @@ configuration:
124124

125125
- description: Alert authors to edits in the /articles/reliability folder.
126126
if:
127-
# If a PR in the articles/reliability folder was opened or had the ready-to-merge label added, and the PR author isn't Anastasia or John...
127+
# If a PR in the articles/reliability folder is opened, and the PR author isn't Anastasia or John...
128128
- payloadType: Pull_Request
129-
- or:
130-
- isAction:
131-
action: Opened
132-
- labelAdded:
133-
label: ready-to-merge
134129
- filesMatchPattern:
135130
matchAny: true
136131
pattern: articles/reliability/*
132+
- isAction:
133+
action: Opened
137134
- not:
138135
or:
139136
- isActivitySender:
140137
user: anaharris-ms
141138
- isActivitySender:
142139
user: johndowns
143140
then:
144-
# Add the needs-human-review label, remove the ready-to-merge label (if necessary), mention Anastasia and John, and add a reply asking the PR author not to sign off on the PR.
141+
# Mention Anastasia and John, add a reply asking the PR author not to sign off on the PR, and add the needs-human-review label.
145142
- mentionUsers:
146143
mentionees:
147144
- anaharris-ms
@@ -150,9 +147,35 @@ configuration:
150147
Tagging authors for this folder: ${mentionees}
151148
- addReply:
152149
reply: >-
153-
@${issueAuthor} - Please do NOT sign off on this pull request. The article author will sign off for you.
150+
@${issueAuthor} - Please do NOT sign off on this pull request. The Reliability Hub owners will sign off for you.
154151
- addLabel:
155152
label: needs-human-review
153+
154+
- description: Disallow sign-off for articles in the /articles/reliability folder.
155+
if:
156+
# If a 'sign-off' comment is added to a PR in the articles/reliability folder , and the PR author isn't Anastasia or John...
157+
- payloadType: Issue_Comment
158+
- isPullRequest
159+
- filesMatchPattern:
160+
matchAny: true
161+
pattern: articles/reliability/*
162+
- commentContains:
163+
pattern: \#sign-off
164+
isRegex: false
165+
- not:
166+
or:
167+
- isActivitySender:
168+
user: anaharris-ms
169+
- isActivitySender:
170+
user: johndowns
171+
then:
172+
# Add the do-not-merge label, remove the ready-to-merge label, and add a reply asking the PR author not to sign off on the PR.
173+
- mentionUsers:
174+
- addReply:
175+
reply: >-
176+
@${issueAuthor} - Please do NOT sign off on this pull request. The Reliability Hub owners will sign off for you.
177+
- addLabel:
178+
label: do-not-merge
156179
- removeLabel:
157180
label: ready-to-merge
158181

0 commit comments

Comments
 (0)