Skip to content

Commit 2bfb156

Browse files
author
Alvaro Muñoz
committed
d /Users/pwntester/src/github.com/github/codeql-actions/ql
1 parent 610dcaf commit 2bfb156

File tree

1 file changed

+10
-5
lines changed
  • ql/lib/codeql/actions/ast/internal

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ class ReusableWorkflowImpl extends AstNodeImpl, WorkflowImpl {
416416

417417
override AstNodeImpl getAChildNode() { result.getNode() = n.getAChildNode*() }
418418

419+
override EventImpl getATriggerEvent() {
420+
this.getACaller().getEnclosingWorkflow().getOn().getAnEvent() = result
421+
or
422+
this.getOn().getAnEvent() = result and not result.getName() = "workflow_call"
423+
}
424+
419425
OutputsImpl getOutputs() { result.getNode() = workflow_call.(YamlMapping).lookup("outputs") }
420426

421427
ExpressionImpl getAnOutputExpr() { result = this.getOutputs().getAnOutputExpr() }
@@ -796,12 +802,11 @@ class JobImpl extends AstNodeImpl, TJobNode {
796802
StrategyImpl getStrategy() { result.getNode() = n.lookup("strategy") }
797803

798804
/** Gets the trigger event that starts this workflow. */
799-
EventImpl getATriggerEvent() { result = this.getEnclosingWorkflow().getATriggerEvent() }
805+
EventImpl getATriggerEvent() {
806+
result = this.getEnclosingWorkflow().getATriggerEvent() or
807+
result = this.getEnclosingWorkflow().(ReusableWorkflowImpl).getACaller().getATriggerEvent()
808+
}
800809

801-
// private predicate hasSingleTrigger(string trigger) {
802-
// this.getATriggerEvent().getName() = trigger and
803-
// count(this.getATriggerEvent()) = 1
804-
// }
805810
/** Gets the runs-on field of the job. */
806811
string getARunsOnLabel() {
807812
exists(ScalarValueImpl lbl, YamlMappingLikeNode runson |

0 commit comments

Comments
 (0)