From 338d3834c4beaaf04c3b62c10bf37867f287fbc4 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Thu, 5 Jun 2025 10:21:24 +0100 Subject: [PATCH] Actions: Make `Env` non-abstract `class Env` was previously abstract with no concrete descendants, so user queries like `any(Env e | ...)` would never produce results. In the JS library the corresponding class derived from `YamlNode` and has concrete descendants representing workflow-, job- and step-level `env` nodes. However these are dubiously useful since you can always just use `any(Step s).getEnv()` to achieve the same result. Since `EnvImpl` already fully characterises an `env` node, I simply make the class concrete. --- actions/ql/lib/codeql/actions/Ast.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/ql/lib/codeql/actions/Ast.qll b/actions/ql/lib/codeql/actions/Ast.qll index 8c1925f3288c..ae19a7a7e8ca 100644 --- a/actions/ql/lib/codeql/actions/Ast.qll +++ b/actions/ql/lib/codeql/actions/Ast.qll @@ -50,8 +50,8 @@ class Expression extends AstNode instanceof ExpressionImpl { string getNormalizedExpression() { result = normalizeExpr(expression) } } -/** A common class for `env` in workflow, job or step. */ -abstract class Env extends AstNode instanceof EnvImpl { +/** An `env` in workflow, job or step. */ +class Env extends AstNode instanceof EnvImpl { /** Gets an environment variable value given its name. */ ScalarValueImpl getEnvVarValue(string name) { result = super.getEnvVarValue(name) }