mirror of
https://github.com/github/codeql.git
synced 2026-01-02 09:16:34 +01:00
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
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user