File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ def workflow_info(content):
117117def used_for_releases (yml ) -> bool :
118118 result = False
119119 on = yml [True ]
120- if on and not isinstance (on , str ):
120+ if on and not isinstance (on , str ) and not isinstance ( on , list ) :
121121 if on .get ("release" ):
122122 for type in on .get ("release" ).get ("types" ):
123123 if type == "published" :
Original file line number Diff line number Diff line change @@ -174,3 +174,16 @@ def test_returns_false_when_no_release(self):
174174 ),
175175 "Workflow shouldn't be used for releases, but it was"
176176 )
177+
178+ @pytest .mark .fast
179+ def test_returns_false_on_simple_list (self ):
180+ self .assertFalse (
181+ used_for_releases (
182+ yaml .safe_load (
183+ """
184+ on: [push, pull_request]
185+ """
186+ )
187+ ),
188+ "Workflow shouldn't be used for releases, but it was"
189+ )
You can’t perform that action at this time.
0 commit comments