Skip to content

Commit

Permalink
Raise in the future if there are no entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlondschien committed Jan 22, 2024
1 parent 2aa8b57 commit f818256
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
paths:
- '.github/workflows/weekly.yml'
- '.github/workflows/crispybeefbot.py'
- 'crispybeefbot.py'

jobs:
crispy-beef-check:
Expand Down
3 changes: 3 additions & 0 deletions crispybeefbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
entries_this_week = response["weekly-rota-array"][0]["day-of-week-array"]
crispy_beefs = []

if len(entries_this_week) == 0:
raise ValueError("No entries this week. Is this correct?")

for entry in entries_this_week:
day = entry.get("day-of-week-desc")
if day in ["Samstag", "Sonntag"]:
Expand Down

0 comments on commit f818256

Please sign in to comment.