Skip to content

Commit 9ddca10

Browse files
authored
use md5 of task name for section id in gitlab ci
Resolves #3787
1 parent dce9f78 commit 9ddca10

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Executor/Messenger.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ public function startTask(Task $task): void
5252
if (getenv('GITHUB_WORKFLOW')) {
5353
$this->output->writeln("::group::task {$task->getName()}");
5454
} else if (getenv('GITLAB_CI')) {
55+
$sectionId = md5($task->getName());
5556
$start = round($this->startTime/1000);
56-
$this->output->writeln("\e[0Ksection_start:{$start}:{$start}[collapsed=true]\r\e[0K{$task->getName()}");
57+
$this->output->writeln("\e[0Ksection_start:{$start}:{$sectionId}[collapsed=true]\r\e[0K{$task->getName()}");
5758
} else {
5859
$this->output->writeln("<fg=cyan;options=bold>task</> {$task->getName()}");
5960
}
@@ -78,9 +79,9 @@ public function endTask(Task $task, bool $error = false): void
7879
if (getenv('GITHUB_WORKFLOW')) {
7980
$this->output->writeln("::endgroup::");
8081
} else if (getenv('GITLAB_CI')) {
82+
$sectionId = md5($task->getName());
8183
$endTime = round($endTime/1000);
82-
$start = round($this->startTime/1000);
83-
$this->output->writeln("\e[0Ksection_end:{$endTime}:{$start}\r\e[0K");
84+
$this->output->writeln("\e[0Ksection_end:{$endTime}:{$sectionId}\r\e[0K");
8485
} else if ($this->output->isVeryVerbose()) {
8586
$this->output->writeln("<fg=yellow;options=bold>done</> {$task->getName()} $taskTime");
8687
}

0 commit comments

Comments
 (0)