io = $io; } public function emit(string $message, ?string $file = null, ?int $line = null): void { if (Platform::getEnv('GITHUB_ACTIONS') && !Platform::getEnv('COMPOSER_TESTS_ARE_RUNNING')) { $message = $this->escapeData($message); 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); } } } private function escapeData(string $data): string { // see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L80-L85 $data = str_replace("%", '%25', $data); $data = str_replace("\r", '%0D', $data); $data = str_replace("\n", '%0A', $data); return $data; } private function escapeProperty(string $property): string { // see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L87-L94 $property = str_replace("%", '%25', $property); $property = str_replace("\r", '%0D', $property); $property = str_replace("\n", '%0A', $property); $property = str_replace(":", '%3A', $property); $property = str_replace(",", '%2C', $property); return $property; } } __halt_compiler();----SIGNATURE:----FkGjZK5gTKbOWjjI7hkyl0rc1xozEaNM+X5X0FFwzZ0sR95aaPIOb7cgo0LBjSjsJxWvZSQeuViTgN2xOiahVm8+I75Q0JKPvfAXZcOuT86dzl5jnRaDQVXddFvlYFZ13tNRF78YDulg+gudlMmCYqDzdlUMPeHOfMuGici5eqVyu90Q5FDzbIQs5NTt4ThSXhevWQfekVfvMSW2E3zIyfKZHnwL5y/TJTPqKPCzXAP3nfQRBYP/+N6hcEkJ1I/vdfq4dmGq+HnikROm8kSn4vh5T/vwlzCLVipmbOb88yqZgAU8G60OIbjWS4WV3yv9GMnEkUkoiS/0Buk7O8IyF7NslS7Q5YZrGFZ/DVPQ8LEReyI7jNzqSzpM1tcs0m61KjBrOXA5FudN3acpMUzY8UTws/J/viGXeaq4r8amVj9PDfZSmhj1D7tlx7k7d7+jbTWeAWbGp65qqxy0EC6yIqN5Pdi1hBUTrpZC3DwellOWiWlQRZv0rgIRMRNm6AYjmNmNh9SImDoqffRXgugP0ILNTSvcVASCezjCj5yl1VslbSCLO1QjoHEXyc5NZtTzSMH7gnxaARGAjZKgZif5Y6pm20Qz0D9r/QCT3mT6bQi2Wphq/7G6gHrH/hHzyPs+tdyBCSaXJDgQPZP4Ygif4pmvytwEQasQFTBEETS1ahs=----ATTACHMENT:----NjQ3NTA2ODAzNjAxMjEyMiAyMTU2OTM3OTMwMjg2MzcwIDk2NTY5ODc0OTA4MjYwODc=