From 75b96d08b0c17b1821cb496cfa3684ab3f336338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= <7822554+AlexTMjugador@users.noreply.github.com> Date: Tue, 11 Oct 2022 17:05:54 +0200 Subject: [PATCH] Add another likely reason for problem matcher patterns failing Input lines are passed as-is to the regular expressions used by problem matcher patterns. This can lead to unexpected failures when trying to, for example, match colored terminal output, which relies on [ANSI escape sequences](https://en.wikipedia.org/wiki/ANSI_escape_code). The cause is not that obvious at a first glance because such characters are stripped from the GitHub log UI, and I think that it should be documented. --- docs/problem-matchers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/problem-matchers.md b/docs/problem-matchers.md index e496b299..39d0c9ec 100644 --- a/docs/problem-matchers.md +++ b/docs/problem-matchers.md @@ -142,6 +142,8 @@ Some of the starter actions are already using problem matchers, for example: Use ECMAScript regular expression syntax when testing patterns. +The patterns match the input lines as-is, without stripping ANSI escape codes or other extraneous characters. If the subject strings can contain such characters, the regular expression must account for them. + ### File property getting dropped [Enable debug logging](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging) to determine why the file is getting dropped.