File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -554,6 +554,10 @@ func (impl *interperterImpl) evaluateLogicalCompare(compareNode *actionlint.Logi
554554
555555 leftValue := reflect .ValueOf (left )
556556
557+ if IsTruthy (left ) == (compareNode .Kind == actionlint .LogicalOpNodeKindOr ) {
558+ return impl .getSafeValue (leftValue ), nil
559+ }
560+
557561 right , err := impl .evaluateNode (compareNode .Right )
558562 if err != nil {
559563 return nil , err
@@ -563,17 +567,8 @@ func (impl *interperterImpl) evaluateLogicalCompare(compareNode *actionlint.Logi
563567
564568 switch compareNode .Kind {
565569 case actionlint .LogicalOpNodeKindAnd :
566- if IsTruthy (left ) {
567- return impl .getSafeValue (rightValue ), nil
568- }
569-
570- return impl .getSafeValue (leftValue ), nil
571-
570+ return impl .getSafeValue (rightValue ), nil
572571 case actionlint .LogicalOpNodeKindOr :
573- if IsTruthy (left ) {
574- return impl .getSafeValue (leftValue ), nil
575- }
576-
577572 return impl .getSafeValue (rightValue ), nil
578573 }
579574
You can’t perform that action at this time.
0 commit comments