Skip to content

Commit fc57142

Browse files
Strip credentials from Git repository URL
1 parent 74d2ac6 commit fc57142

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Logging/OpenTestReporting/InfrastructureInformationProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use const DIRECTORY_SEPARATOR;
1313
use const PHP_OS_FAMILY;
1414
use function assert;
15+
use function explode;
1516
use function fclose;
1617
use function function_exists;
1718
use function getenv;
@@ -112,6 +113,10 @@ public function gitInformation(): array|false
112113

113114
$originUrl = trim(str_replace(' Fetch URL: ', '', $lines[1]));
114115

116+
if (str_contains($originUrl, '@')) {
117+
$originUrl = explode('@', $originUrl)[1];
118+
}
119+
115120
$branch = $this->executeGitCommand('symbolic-ref --short HEAD');
116121

117122
if ($branch === false) {

0 commit comments

Comments
 (0)