File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
ql/lib/codeql/actions/ast/internal Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,12 @@ class ReusableWorkflowImpl extends AstNodeImpl, WorkflowImpl {
416
416
417
417
override AstNodeImpl getAChildNode ( ) { result .getNode ( ) = n .getAChildNode * ( ) }
418
418
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
+
419
425
OutputsImpl getOutputs ( ) { result .getNode ( ) = workflow_call .( YamlMapping ) .lookup ( "outputs" ) }
420
426
421
427
ExpressionImpl getAnOutputExpr ( ) { result = this .getOutputs ( ) .getAnOutputExpr ( ) }
@@ -796,12 +802,11 @@ class JobImpl extends AstNodeImpl, TJobNode {
796
802
StrategyImpl getStrategy ( ) { result .getNode ( ) = n .lookup ( "strategy" ) }
797
803
798
804
/** 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
+ }
800
809
801
- // private predicate hasSingleTrigger(string trigger) {
802
- // this.getATriggerEvent().getName() = trigger and
803
- // count(this.getATriggerEvent()) = 1
804
- // }
805
810
/** Gets the runs-on field of the job. */
806
811
string getARunsOnLabel ( ) {
807
812
exists ( ScalarValueImpl lbl , YamlMappingLikeNode runson |
You can’t perform that action at this time.
0 commit comments