Skip to content

Commit

Permalink
Drop empty allow-input list items
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Sep 29, 2022
1 parent 6887e75 commit 13b4244
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/normalize_needed_jobs_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ def parse_as_list(input_text):
return [s.strip() for s in input_text.split(',')]


def drop_empty_from_list(a_list):
return [list_element for list_element in a_list if list_element]


def parse_inputs(raw_allowed_failures, raw_allowed_skips, raw_jobs):
"""Normalize the action inputs by turning them into data."""
allowed_failures_input = parse_as_list(raw_allowed_failures)
allowed_skips_input = parse_as_list(raw_allowed_skips)
allowed_failures_input = drop_empty_from_list(
parse_as_list(raw_allowed_failures),
)
allowed_skips_input = drop_empty_from_list(
parse_as_list(raw_allowed_skips),
)

return {
'allowed_failures': allowed_failures_input,
Expand Down

0 comments on commit 13b4244

Please sign in to comment.