summary refs log tree commit diff
path: root/.local/bin
diff options
context:
space:
mode:
authorZach DeCook <zach.decook@bettercarpeople.com>2026-05-15 13:09:06 -0400
committerZach DeCook <zach.decook@bettercarpeople.com>2026-05-15 13:09:06 -0400
commit322a14124e504b048fd5e5ae215c93e4cd36a70e (patch)
tree64cd174c42fa71de4a2835d1ea550d9272dfef98 /.local/bin
parent23b8225826fd5fa75a0415cd7cd86554d34308ad (diff)
downloaddotfiles-322a14124e504b048fd5e5ae215c93e4cd36a70e.tar.gz
jira-CR.php: More colors
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/jira-CR.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/.local/bin/jira-CR.php b/.local/bin/jira-CR.php
index 46dce3b..a4d16c8 100755
--- a/.local/bin/jira-CR.php
+++ b/.local/bin/jira-CR.php
@@ -16,6 +16,8 @@ if (!function_exists('array_any')) {
 $ansired = "\033[31m";
 $ansigreen = "\033[32m";
 $ansiyellow = "\033[33m";
+$ansiblue = "\033[34m";
+$ansicyan = "\033[36m";
 $ansireset = "\033[0m";
 
 $padlen = 50;
@@ -29,6 +31,7 @@ $ticketLabels = array_combine(
 
 $params = 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName,mergeable,additions,deletions';
 
+$prs_jsons = [];
 print(str_pad("\rGetting OnBDC2 PR's from github...", $padlen));
 $prs_jsons[] = json_decode(shell_exec("gh pr list -L 50 -R BetterCarPeople/OnBDC2 --json '$params'"), true);
 print(str_pad("\rGetting maple-ai PR's from github...", $padlen));
@@ -39,6 +42,11 @@ $prs_jsons[] = json_decode(shell_exec("gh pr list -R BetterCarPeople/maple-web -
 print(str_pad("\r", $padlen));
 print("\r");
 
+if (empty(array_filter($prs_jsons))) {
+    print("Didn't get anything from Github\n");
+    exit(1);
+}
+
 $prs_json = array_merge(...$prs_jsons);
 $output = "";
 $has_pr = [];
@@ -57,7 +65,7 @@ foreach ($prs_json as $pr) {
 
         $labels = $ticketLabels[$pr_ticket] ?? [];
         $labelsText = trim(
-            (in_array("Successful_Demonstration", $labels) ? "๐Ÿ“บ Demo'd " : '')
+            (in_array("Successful_Demonstration", $labels) ? ($ansiblue . "๐Ÿ“บ Demo'd " . $ansireset)  : "")
             . (in_array("Hot", $labels) ? "๐Ÿ”ฅ Hot " : '')
         );
 
@@ -73,6 +81,7 @@ foreach ($prs_json as $pr) {
             }
         }
         $failed = $failedPipes ? (str_repeat("๐Ÿงช๐Ÿ’”", count($failedPipes)) . ": " . implode(", ", $failedPipes) . '. ') : '';
+        $failed = $failed ? ($ansicyan . $failed . $ansireset) : "";
 
         $pipeline_status = $failed;