From d7154c2a72101b40c0f93daeea9b81dd484129c3 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 2 Nov 2021 14:39:04 +0100 Subject: [PATCH] Fix GithubActionError on php 8.1 (#10250) --- src/Composer/Console/GithubActionError.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Console/GithubActionError.php b/src/Composer/Console/GithubActionError.php index ef33ae003..49048ffcf 100644 --- a/src/Composer/Console/GithubActionError.php +++ b/src/Composer/Console/GithubActionError.php @@ -37,11 +37,12 @@ final class GithubActionError { if (getenv('GITHUB_ACTIONS') && !getenv('COMPOSER_TESTS_ARE_RUNNING')) { $message = $this->escapeData($message); - $file = $this->escapeProperty($file); if ($file && $line) { + $file = $this->escapeProperty($file); $this->io->write("::error file=". $file .",line=". $line ."::". $message); } elseif ($file) { + $file = $this->escapeProperty($file); $this->io->write("::error file=". $file ."::". $message); } else { $this->io->write("::error ::". $message);