|
| 1 | +automations: |
| 2 | + |
| 3 | + ############################################################################################################ |
| 4 | + # PR Automation # |
| 5 | + ############################################################################################################ |
| 6 | + # 1. Whenever a pull request is labeled with the "Project: Community Picked" label: |
| 7 | + # a. it must be assigned to the "Community Dashboard" project |
| 8 | + # b. it must be removed from the "Pull Requests Dashboard" project |
| 9 | + - trigger: pull_request.labeled |
| 10 | + conditions: |
| 11 | + - ['modifiedLabel.name', 'eq', 'Project: Community Picked'] |
| 12 | + - ['projects#number', 'in', 23] ## this one is for safety reasons to ensure that PR is assigned to project XX |
| 13 | + actions: |
| 14 | + - addToProject: [22] #['Community Dashboard'] |
| 15 | + - moveTo: [22, '${projectsByNumber.23.column.name}'] |
| 16 | + - removeFromProject: [23] #['Pull Requests Dashboard'] |
| 17 | + |
| 18 | + # 2. Whenever a pull request is labeled with the "Priority: XX" label and has no "Project: Community Picked" label assigned: |
| 19 | + # a. it must be assigned to the "Pull Requests Dashboard" project |
| 20 | + # b. it must be removed from the "Community Dashboard" project (if assigned to it) |
| 21 | + # c. it must be labeled with the "Progress: pending review" label |
| 22 | + # d. it must be moved to the "Pending review" column on the "Pull Requests Dashboard" project |
| 23 | + - trigger: pull_request.labeled |
| 24 | + conditions: |
| 25 | + - ['modifiedLabel.name', 'includes', 'Priority:'] |
| 26 | + - ['labels#name', 'ne', 'Project: Community Picked'] |
| 27 | + actions: |
| 28 | + - addToProject: [23] #['Pull Requests Dashboard'] |
| 29 | + - moveTo: [23, 'Pending Review'] #['Pull Requests Dashboard', 'Pending Review'] |
| 30 | + - removeFromProject: [22] #['Community Dashboard'] |
| 31 | + - addLabels: ['Progress: pending review'] |
| 32 | + |
| 33 | + # 3. Whenever a review was requested for a pull request and its not in Changes Requested |
| 34 | + # a. it must be labeled with the "Progress: review" label |
| 35 | + # b. it must remove the "Progress: needs update" label |
| 36 | + # c. it must be moved to the "Review in Progress" column |
| 37 | + - trigger: pull_request.review_requested |
| 38 | + conditions: |
| 39 | + actions: |
| 40 | + - addLabels: ['Progress: review'] |
| 41 | + - removeLabels: ['Progress: needs update', 'Progress: pending review'] |
| 42 | + - moveTo: [23, 'Review in Progress'] #['Pull Requests Dashboard', 'Review in Progress'] |
| 43 | + - moveTo: [22, 'Review in Progress'] #['Community Dashboard', 'Review in Progress'] |
| 44 | + |
| 45 | + # 4. Whenever a pull request is labeled with the "Progress: needs update" label and the reviewer adds comment/s: |
| 46 | + # a. it must be moved to the "Changes Requested" column |
| 47 | + - trigger: pull_request.labeled |
| 48 | + conditions: |
| 49 | + - ['modifiedLabel.name', 'eq', 'Progress: needs update'] |
| 50 | + actions: |
| 51 | + - removeLabels: [ 'Progress: review' ] |
| 52 | + - moveTo: [23, 'Changes Requested'] #['Pull Requests Dashboard', 'Changes Requested'] |
| 53 | + - moveTo: [22, 'Changes Requested'] #['Community Dashboard', 'Changes Requested'] |
| 54 | + |
| 55 | + # 5. Whenever a label "Progress: needs update" is removed from a pull request: |
| 56 | + # a. it must be labeled with "Progress: review" |
| 57 | + # b. it must be moved to the "Review in Progress" column |
| 58 | + - trigger: pull_request.unlabeled |
| 59 | + conditions: |
| 60 | + - ['modifiedLabel.name', 'eq', 'Progress: needs update'] |
| 61 | + actions: |
| 62 | + - addLabels: ['Progress: review'] |
| 63 | + - removeLabels: ['Progress: pending review'] |
| 64 | + # Action moveTo will be skipped if the PR or issue is not in the project, this is why we can safely use the same action for both projects |
| 65 | + - moveTo: [23, 'Review in Progress'] #['Pull Requests Dashboard', 'Review in Progress'] |
| 66 | + - moveTo: [22, 'Review in Progress'] #['Community Dashboard', 'Review in Progress'] |
| 67 | + |
| 68 | + # 6. Whenever a pull request is approved: |
| 69 | + # a. the below labels must be removed from a pull request: "Progress: review", "Progress: needs update" |
| 70 | + # b. it must be moved to the "Ready for Testing" column |
| 71 | + - trigger: pull_request_review.submitted |
| 72 | + conditions: |
| 73 | + - ['review#state', 'eq', 'approved'] |
| 74 | + actions: |
| 75 | + - removeLabels: ['Progress: review'] |
| 76 | + - moveTo: [23, 'Ready for Testing'] #['Pull Requests Dashboard', 'Ready for Testing'] |
| 77 | + - moveTo: [22, 'Ready for Testing'] #['Community Dashboard', 'Ready for Testing'] |
| 78 | + |
| 79 | + # 7. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Pending review" column: |
| 80 | + # a. it must be labeled with the "Progress: pending review" label |
| 81 | + - trigger: projects_v2_item.edited |
| 82 | + conditions: |
| 83 | + - ['movedToColumn.name', 'eq', 'Pending Review'] |
| 84 | + - [ |
| 85 | + ['projects#number', 'in', 22], |
| 86 | + ['projects#number', 'in', 23] |
| 87 | + ] |
| 88 | + actions: |
| 89 | + - addLabels: ['Progress: pending review'] |
| 90 | + - removeLabels: ['Progress: needs update'] |
| 91 | + |
| 92 | + # 8. Whenever a pull request is in the "Ready for Testing" column and gets assigned to anyone: |
| 93 | + # a. it must be labeled with the "Progress: testing in progress" label |
| 94 | + # b. it must remove the "Progress: ready for testing" label |
| 95 | + # c. it must be moved to the "Testing in Progress" column |
| 96 | + - trigger: pull_request.assigned |
| 97 | + conditions: |
| 98 | + - ['projects#column.name', 'in', 'Ready for Testing'] |
| 99 | + actions: |
| 100 | + - addLabels: ['Progress: testing in progress'] |
| 101 | + - removeLabels: ['Progress: ready for testing'] |
| 102 | + - moveTo: [23, 'Testing in Progress'] #['Pull Requests Dashboard', 'Testing in Progress'] |
| 103 | + - moveTo: [22, 'Testing in Progress'] #['Community Dashboard', 'Testing in Progress'] |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + # 9. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Review in Progress" column: |
| 108 | + # a. it must be labeled with the "Progress: review" label |
| 109 | + - trigger: projects_v2_item.edited |
| 110 | + conditions: |
| 111 | + - ['movedToColumn.name', 'eq', 'Review in Progress'] |
| 112 | + - [ |
| 113 | + ['projects#number', 'in', 22], |
| 114 | + ['projects#number', 'in', 23] |
| 115 | + ] |
| 116 | + actions: |
| 117 | + - addLabels: ['Progress: review'] |
| 118 | + - removeLabels: ['Progress: needs update'] |
| 119 | + |
| 120 | + # 10. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Changes Requested" column: |
| 121 | + # a. it must be labeled with the "Progress: needs updates" label |
| 122 | + # b. it must remove the "Progress: review" label |
| 123 | + - trigger: projects_v2_item.edited |
| 124 | + conditions: |
| 125 | + - ['movedToColumn.name', 'eq', 'Changes Requested'] |
| 126 | + - [ |
| 127 | + ['projects#number', 'in', 22], |
| 128 | + ['projects#number', 'in', 23] |
| 129 | + ] |
| 130 | + actions: |
| 131 | + - addLabels: ['Progress: needs update'] |
| 132 | + - removeLabels: ['Progress: review'] |
| 133 | + |
| 134 | + # 11. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "On Hold" column: |
| 135 | + # a. it must be labeled with the "Progress: On Hold" label |
| 136 | + # b. it must remove the "Progress: review", "Progress: needs update","Progress: testing in progress", "Progress: extended testing" label |
| 137 | + - trigger: projects_v2_item.edited |
| 138 | + conditions: |
| 139 | + - ['movedToColumn.name', 'eq', 'On Hold'] |
| 140 | + - [ |
| 141 | + ['projects#number', 'in', 22], |
| 142 | + ['projects#number', 'in', 23] |
| 143 | + ] |
| 144 | + actions: |
| 145 | + - addLabels: ['Progress: On Hold'] |
| 146 | + - removeLabels: ['Progress: review', 'Progress: needs update', 'Progress: testing in progress', 'Progress: extended testing' ] |
| 147 | + |
| 148 | + # 12. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Ready for Testing" column: |
| 149 | + # a. it must be labeled with the "Progress: ready for testing" label |
| 150 | + # b. it must remove the "Progress: review" label |
| 151 | + - trigger: projects_v2_item.edited |
| 152 | + conditions: |
| 153 | + - ['movedToColumn.name', 'eq', 'Ready for Testing'] |
| 154 | + - [ |
| 155 | + ['projects#number', 'in', 22], |
| 156 | + ['projects#number', 'in', 23] |
| 157 | + ] |
| 158 | + actions: |
| 159 | + - addLabels: ['Progress: ready for testing'] |
| 160 | + - removeLabels: ['Progress: review', 'Progress: needs update'] |
| 161 | + |
| 162 | + # 13. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Extended Testing" column: |
| 163 | + # a. it must be labeled with the "Progress: extended testing" label |
| 164 | + # b. it must remove the "Progress: testing in progress" label |
| 165 | + - trigger: projects_v2_item.edited |
| 166 | + conditions: |
| 167 | + - ['movedToColumn.name', 'eq', 'Extended Testing (optional)'] |
| 168 | + - [ |
| 169 | + ['projects#number', 'in', 22], |
| 170 | + ['projects#number', 'in', 23] |
| 171 | + ] |
| 172 | + actions: |
| 173 | + - addLabels: ['Progress: extended testing'] |
| 174 | + - removeLabels: ['Progress: testing in progress', 'Progress: pending approval'] |
| 175 | + |
| 176 | + # 14. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "To Approve" column: |
| 177 | + # a. it must be labeled with the "Progress: to approve" label |
| 178 | + # b. it must remove the "Progress: extended testing" label |
| 179 | + - trigger: projects_v2_item.edited |
| 180 | + conditions: |
| 181 | + - ['movedToColumn.name', 'eq', 'To Approve'] |
| 182 | + - [ |
| 183 | + ['projects#number', 'in', 22], |
| 184 | + ['projects#number', 'in', 23] |
| 185 | + ] |
| 186 | + actions: |
| 187 | + - addLabels: ['Progress: to approve'] |
| 188 | + - removeLabels: ['Progress: extended testing'] |
| 189 | + |
| 190 | + # 15. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Pending Approval" column: |
| 191 | + # a. it must be labeled with the "Progress: pending approval" label |
| 192 | + # b. it must remove the "Progress: to approve" label |
| 193 | + - trigger: projects_v2_item.edited |
| 194 | + conditions: |
| 195 | + - ['movedToColumn.name', 'eq', 'Pending Approval'] |
| 196 | + - [ |
| 197 | + ['projects#number', 'in', 22], |
| 198 | + ['projects#number', 'in', 23] |
| 199 | + ] |
| 200 | + actions: |
| 201 | + - addLabels: ['Progress: pending approval'] |
| 202 | + - removeLabels: ['Progress: to approve'] |
| 203 | + |
| 204 | + # 16. Whenever a pull request belongs to the "Community Dashboard" or "Pull Requests Dashboard" and is moved to the "Merge in Progress" column: |
| 205 | + # a. it must remove the "Progress: extended testing" label |
| 206 | + - trigger: projects_v2_item.edited |
| 207 | + conditions: |
| 208 | + - ['movedToColumn.name', 'eq', 'Merge in Progress'] |
| 209 | + - [ |
| 210 | + ['projects#number', 'in', 22], |
| 211 | + ['projects#number', 'in', 23] |
| 212 | + ] |
| 213 | + actions: |
| 214 | + - removeLabels: ['Progress: extended testing'] |
| 215 | + |
| 216 | + # 17. Whenever a pull request is merged: |
| 217 | + # a. it must be moved to the "Recently Merged" column |
| 218 | + - trigger: pull_request.closed |
| 219 | + conditions: |
| 220 | + - ['merged', 'eq', true] |
| 221 | + actions: |
| 222 | + - moveTo: [23, 'Recently Merged'] #['Pull Requests Dashboard', 'Recently Merged'] |
| 223 | + |
| 224 | + # 18. Whenever a pull request is closed: |
| 225 | + # a. it must be removed from the "Pull Requests Dashboard" project |
| 226 | + # b. it must be removed from the "Community Dashboard" project |
| 227 | + - trigger: pull_request.closed |
| 228 | + conditions: |
| 229 | + - ['merged', 'ne', true] |
| 230 | + actions: |
| 231 | + - removeFromProject: [23] #['Pull Requests Dashboard'] |
| 232 | + - removeFromProject: [22] #['Community Dashboard'] |
0 commit comments