From 322a14124e504b048fd5e5ae215c93e4cd36a70e Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 15 May 2026 13:09:06 -0400 Subject: jira-CR.php: More colors --- .local/bin/jira-CR.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to '.local') 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; -- cgit 1.4.1