mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Fixes maintainer detection for review auto-tagging (#31307)
* Fixes maintainer detection for review auto-tagging * User not author * oranges was right
This commit is contained in:
@@ -99,11 +99,8 @@ switch (strtolower($_SERVER['HTTP_X_GITHUB_EVENT'])) {
|
||||
case 'pull_request_review':
|
||||
if($payload['action'] == 'submitted'){
|
||||
$lower_state = strtolower($payload['review']['state']);
|
||||
if(($lower_state == 'approved' || $lower_state == 'changes_requested') && is_maintainer($payload, $payload['review']['user']['login'])){
|
||||
$lower_association = strtolower($payload['review']['author_association']);
|
||||
if($lower_association == 'member' || $lower_association == 'contributor' || $lower_association == 'owner')
|
||||
remove_ready_for_review($payload);
|
||||
}
|
||||
if(($lower_state == 'approved' || $lower_state == 'changes_requested') && is_maintainer($payload, $payload['review']['user']['login']))
|
||||
remove_ready_for_review($payload);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -286,9 +283,8 @@ function check_ready_for_review($payload, $labels = null){
|
||||
$reviews_ids_with_changes_requested = array();
|
||||
$dismissed_an_approved_review = false;
|
||||
|
||||
foreach($reviews as $R){
|
||||
$lower_association = strtolower($R['author_association']);
|
||||
if($lower_association == 'member' || $lower_association == 'contributor' || $lower_association == 'owner'){
|
||||
foreach($reviews as $R)
|
||||
if(is_maintainer($R['user']['login'])){
|
||||
$lower_state = strtolower($R['state']);
|
||||
if($lower_state == 'changes_requested')
|
||||
$reviews_ids_with_changes_requested[] = $R['id'];
|
||||
@@ -297,7 +293,6 @@ function check_ready_for_review($payload, $labels = null){
|
||||
$dismissed_an_approved_review = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$dismissed_an_approved_review && count($reviews_ids_with_changes_requested) == 0){
|
||||
if($has_label_already)
|
||||
|
||||
Reference in New Issue
Block a user