From edbd0bae92c03a36d017f5858bfc7ea230b0e981 Mon Sep 17 00:00:00 2001 From: thc202 Date: Wed, 19 Nov 2025 10:49:05 +0000 Subject: [PATCH] Do not check for log misconfigurations in stable The current release does not have the necessary class exposed. Signed-off-by: thc202 --- .github/workflows/conf/af-check-errors.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/conf/af-check-errors.yml b/.github/workflows/conf/af-check-errors.yml index 6dbabc2a4d1..d66b8cc1e5b 100644 --- a/.github/workflows/conf/af-check-errors.yml +++ b/.github/workflows/conf/af-check-errors.yml @@ -14,25 +14,29 @@ jobs: inline: | const ArrayList = Java.type("java.util.ArrayList") const Collections = Java.type("java.util.Collections") - const DelegatorPrintStream = Java.extend(Java.type("org.zaproxy.zap.ZAP$DelegatorPrintStream")) + const Constant = Java.type("org.parosproxy.paros.Constant") const ScriptVars = Java.type("org.zaproxy.zap.extension.script.ScriptVars") const System = Java.type("java.lang.System") const errors = Collections.synchronizedList(new ArrayList()) ScriptVars.setGlobalCustomVar("errors", errors) - const previousSysErr = System.err - const ps = new DelegatorPrintStream(previousSysErr) { - println: function(x) { - previousSysErr.println(x) + if (Constant.isDailyBuild() || Constant.isDevBuild()) { + const DelegatorPrintStream = Java.extend(Java.type("org.zaproxy.zap.ZAP$DelegatorPrintStream")) - // Strings are split as scripts are shown in the log file - if (x && (x.startsWith("SLF" + "4J") || x.startsWith("log" + "4j:"))) { - errors.add(x) + const previousSysErr = System.err + const ps = new DelegatorPrintStream(previousSysErr) { + println: function(x) { + previousSysErr.println(x) + + // Strings are split as scripts are shown in the log file + if (x && (x.startsWith("SLF" + "4J") || x.startsWith("log" + "4j:"))) { + errors.add(x) + } } } + System.setErr(ps) } - System.setErr(ps) - type: script parameters: action: "run"