From 6609d4ccb894fbf2473a1f3969823a56886deb18 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 29 Jan 2024 10:12:04 +1300 Subject: [PATCH] FIX Init array and use $oldName --- labels_command.php | 3 ++- run.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/labels_command.php b/labels_command.php index 58847ba..5d67c07 100644 --- a/labels_command.php +++ b/labels_command.php @@ -99,9 +99,10 @@ } else { github_api($url, ['new_name' => $newName], 'PATCH'); } + $oldName = $name; $name = $newName; // Update $url replacing the $name at the end with $newName - $url = substr($url, 0, strlen($url) - strlen($name)) . $newName; + $url = substr($url, 0, strlen($url) - strlen($oldName)) . $newName; $labels[$key]['name'] = $newName; $labels[$key]['url'] = $url; } diff --git a/run.php b/run.php index df3dd80..726605a 100644 --- a/run.php +++ b/run.php @@ -24,6 +24,7 @@ $MODULE_DIR = ''; $PRS_CREATED = []; $REPOS_WITH_PRS_CREATED = []; +$REPOS_WITH_LABELS_UPDATED = []; $OUT = null; // options