Skip to content

Commit e34835f

Browse files
author
Alvaro Muñoz
committed
fix: AstNode.getATriggerEvent()
getATriggerEvent did not work for nodes outside a Job. If there is no enclosing job, get the trigger from the enclosing workflow
1 parent 6136a98 commit e34835f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • ql/lib/codeql/actions/ast/internal

ql/lib/codeql/actions/ast/internal/Ast.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ abstract class AstNodeImpl extends TAstNode {
114114
/**
115115
* Gets and Event triggering this node.
116116
*/
117-
EventImpl getATriggerEvent() { result = this.getEnclosingJob().getATriggerEvent() }
117+
EventImpl getATriggerEvent() {
118+
result = this.getEnclosingJob().getATriggerEvent()
119+
or
120+
not exists(this.getEnclosingJob()) and result = this.getEnclosingWorkflow().getATriggerEvent()
121+
}
118122

119123
/**
120124
* Gets the enclosing Step.

0 commit comments

Comments
 (0)