Skip to content

Commit dfbf9c9

Browse files
committed
Merge branch '__rultor'
2 parents 6044650 + 99f2415 commit dfbf9c9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

sr-data/src/sr_data/steps/workflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def workflow_info(content):
117117
def 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":

sr-data/src/tests/test_workflows.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
)

0 commit comments

Comments
 (0)