Skip to content

Commit 5b152a8

Browse files
Add automation for label Highest-Version-Remaining - round 2 (microsoft#155074)
1 parent 2f96c3a commit 5b152a8

File tree

4 files changed

+96
-45
lines changed

4 files changed

+96
-45
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
id: labelAdded.highestVersionRemoval
2+
name: GitOps.PullRequestIssueManagement
3+
description: Handlers when "Highest-Version-Removal" label is added
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: >-
12+
When the label "Highest-Version-Removal" is added to a pull request
13+
* Add a reply notifying the issue author
14+
* Assign to the author
15+
* Label with Needs-Author-Feedback
16+
if:
17+
- payloadType: Pull_Request
18+
- labelAdded:
19+
label: Highest-Version-Removal
20+
then:
21+
- addReply:
22+
reply: >-
23+
Hello @${issueAuthor},
24+
25+
26+
This PR removes the highest available version of the package from the repository.
27+
28+
29+
Please provide the reason for removal to help our moderators understand the context.
30+
31+
32+
Template: msftbot/highestVersionRemoval
33+
- assignTo:
34+
author: True
35+
- addLabel:
36+
label: Needs-Author-Feedback
37+
# The policy service should trigger even when the label was added by the policy service
38+
triggerOnOwnActions: true
39+
onFailure:
40+
onSuccess:
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
id: labelAdded.lastVersionRemaining
2-
name: GitOps.PullRequestIssueManagement
3-
description: Handlers when "Last-Version-Remaining" label is added
4-
owner:
5-
resource: repository
6-
disabled: false
7-
where:
8-
configuration:
9-
resourceManagementConfiguration:
10-
eventResponderTasks:
11-
- description: >-
12-
When the label "Last-Version-Remaining" is added to a pull request
13-
* Add a reply notifying the issue author
14-
* Assign to the author
15-
* Label with Needs-Author-Feedback
16-
if:
17-
- payloadType: Pull_Request
18-
- labelAdded:
19-
label: Last-Version-Remaining
20-
then:
21-
- addReply:
22-
reply: >-
23-
Hello @${issueAuthor},
24-
25-
26-
This PR removes the last version of the package from the repository.
27-
28-
29-
Please check if the package requires an update or is available from another source.
30-
31-
32-
Template: msftbot/lastVersionRemaining
33-
- assignTo:
34-
author: True
35-
- addLabel:
36-
label: Needs-Author-Feedback
37-
# The policy service should trigger even when the label was added by the policy service
38-
triggerOnOwnActions: true
39-
onFailure:
40-
onSuccess:
1+
id: labelAdded.lastVersionRemoval
2+
name: GitOps.PullRequestIssueManagement
3+
description: Handlers when "Last-Version-Removal" label is added
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: >-
12+
When the label "Last-Version-Removal" is added to a pull request
13+
* Add a reply notifying the issue author
14+
* Assign to the author
15+
* Label with Needs-Author-Feedback
16+
if:
17+
- payloadType: Pull_Request
18+
- labelAdded:
19+
label: Last-Version-Removal
20+
then:
21+
- addReply:
22+
reply: >-
23+
Hello @${issueAuthor},
24+
25+
26+
This PR removes the last version of the package from the repository.
27+
28+
29+
Please check if the package requires an update or is available from another source.
30+
31+
32+
Template: msftbot/lastVersionRemoval
33+
- assignTo:
34+
author: True
35+
- addLabel:
36+
label: Needs-Author-Feedback
37+
# The policy service should trigger even when the label was added by the policy service
38+
triggerOnOwnActions: true
39+
onFailure:
40+
onSuccess:

.github/policies/moderatorTriggers.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ configuration:
172172
then:
173173
- addLabel:
174174
label: Help-Wanted
175+
# Highest-Version-Removal
176+
- if:
177+
- commentContains:
178+
pattern: '\[[Pp]olicy\]\s+[Hh]ighest[\s-][Vv]ersion([\s-][Rr]emoval)?'
179+
isRegex: True
180+
then:
181+
- addLabel:
182+
label: Highest-Version-Removal
175183
# In-PR
176184
- if:
177185
- commentContains:
@@ -222,14 +230,14 @@ configuration:
222230
then:
223231
- addLabel:
224232
label: Issue-Feature
225-
# Highest-Version-Remaining
233+
# Last-Version-Removal
226234
- if:
227235
- commentContains:
228-
pattern: '\[[Pp]olicy\]\s+[Hh]ighest[\s-][Vv]ersion([\s-][Rr]emaining)?'
236+
pattern: '\[[Pp]olicy\]\s+[Ll]ast[\s-][Vv]ersion([\s-][Rr]emoval)?'
229237
isRegex: True
230238
then:
231239
- addLabel:
232-
label: Highest-Version-Remaining
240+
label: Last-Version-Removal
233241
# License-Blocks-Install
234242
- if:
235243
- commentContains:
@@ -458,7 +466,7 @@ configuration:
458466
- removeLabel:
459467
label: Help-Wanted
460468
- removeLabel:
461-
label: Highest-Version-Remaining
469+
label: Highest-Version-Removal
462470
- removeLabel:
463471
label: In-PR
464472
- removeLabel:
@@ -471,6 +479,8 @@ configuration:
471479
label: Issue-Docs
472480
- removeLabel:
473481
label: Issue-Feature
482+
- removeLabel:
483+
label: Last-Version-Removal
474484
- removeLabel:
475485
label: License-Blocks-Install
476486
- removeLabel:

doc/Moderation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ Moderators are often the first to see and triage new issues, and so they have th
9999
* `Error-Hash-Mismatch`
100100
* `Hardware`
101101
* `Help-Wanted`
102+
* `Highest-Version-Removal`
102103
* `In-PR`
103104
* `Installer-Issue`
104105
* `Interactive-Only-Installer`
105106
* `Issue-Bug`
106107
* `Issue-Docs`
107108
* `Issue-Feature`
108-
* `Last-Version-Remaining`
109+
* `Last-Version-Removal`
109110
* `License-Blocks-Install`
110111
* `Manifest-Content-Incomplete`
111112
* `Moderator-Approved`

0 commit comments

Comments
 (0)