@@ -128,6 +128,8 @@ class ScalarValueImpl extends AstNodeImpl, TScalarValueNode {
128128 override Location getLocation ( ) { result = value .getLocation ( ) }
129129
130130 override YamlScalar getNode ( ) { result = value }
131+
132+ string getValue ( ) { result = value .getValue ( ) }
131133}
132134
133135class ExpressionImpl extends AstNodeImpl , TExpressionNode {
@@ -687,7 +689,19 @@ abstract class UsesImpl extends AstNodeImpl {
687689
688690 abstract string getVersion ( ) ;
689691
690- abstract ExpressionImpl getArgumentExpr ( string key ) ;
692+ /** Gets the argument expression for the given key. */
693+ string getArgument ( string key ) {
694+ exists ( ScalarValueImpl scalar |
695+ scalar .getNode ( ) = this .getNode ( ) .( YamlMapping ) .lookup ( "with" ) .( YamlMapping ) .lookup ( key ) and
696+ result = scalar .getValue ( )
697+ )
698+ }
699+
700+ /** Gets the argument expression for the given key (if it exists). */
701+ ExpressionImpl getArgumentExpr ( string key ) {
702+ result .getParentNode ( ) .getNode ( ) =
703+ this .getNode ( ) .( YamlMapping ) .lookup ( "with" ) .( YamlMapping ) .lookup ( key )
704+ }
691705}
692706
693707/**
@@ -719,11 +733,6 @@ class UsesStepImpl extends StepImpl, UsesImpl {
719733 /** Gets the version reference used when checking out the Action, e.g. `v2` in `actions/checkout@v2`. */
720734 override string getVersion ( ) { result = u .getValue ( ) .regexpCapture ( usesParser ( ) , 3 ) }
721735
722- /** Gets the argument expression for the given key. */
723- override ExpressionImpl getArgumentExpr ( string key ) {
724- result .getParentNode ( ) .getNode ( ) = n .lookup ( "with" ) .( YamlMapping ) .lookup ( key )
725- }
726-
727736 override string toString ( ) {
728737 if exists ( this .getId ( ) ) then result = "Uses Step: " + this .getId ( ) else result = "Uses Step"
729738 }
@@ -763,11 +772,6 @@ class ExternalJobImpl extends JobImpl, UsesImpl {
763772 else none ( )
764773 )
765774 }
766-
767- /** Gets the argument expression for the given key. */
768- override ExpressionImpl getArgumentExpr ( string key ) {
769- result .getParentNode ( ) .getNode ( ) = n .lookup ( "with" ) .( YamlMapping ) .lookup ( key )
770- }
771775}
772776
773777class RunImpl extends StepImpl {
0 commit comments