diff --git a/ql/lib/codeql/actions/ast/internal/Ast.qll b/ql/lib/codeql/actions/ast/internal/Ast.qll index ce6db22636c..5f33400bb96 100644 --- a/ql/lib/codeql/actions/ast/internal/Ast.qll +++ b/ql/lib/codeql/actions/ast/internal/Ast.qll @@ -114,7 +114,11 @@ abstract class AstNodeImpl extends TAstNode { /** * Gets and Event triggering this node. */ - EventImpl getATriggerEvent() { result = this.getEnclosingJob().getATriggerEvent() } + EventImpl getATriggerEvent() { + result = this.getEnclosingJob().getATriggerEvent() + or + not exists(this.getEnclosingJob()) and result = this.getEnclosingWorkflow().getATriggerEvent() + } /** * Gets the enclosing Step.