diff --git a/src/BrowserStack.php b/src/BrowserStack.php index 58fed29..fea4c2c 100644 --- a/src/BrowserStack.php +++ b/src/BrowserStack.php @@ -141,6 +141,10 @@ public static function getBuildName(): string $branch = env('GITHUB_HEAD_REF', \exec('git branch --show-current')); $message = self::getRunsMessage().' '.self::getCommitSha(); + if (empty($branch)) { + $branch = env('GITHUB_REF_NAME'); + } + if ($buildMatrix = env('BUILD_MATRIX')) { $numbers .= \sprintf(', Matrix: %s', $buildMatrix); }