Skip to content

Commit 3aa906d

Browse files
fix: parse date and guest from title for manually-created issues
Adds title-based fallbacks for issues not created via the template: - parse_date_from_title() extracts dates in MM-DD-YYYY or 'Month D, YYYY' formats from the issue title - build_row() falls back to title segments for the guest name when the body ### Name field is absent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 18013af commit 3aa906d

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

.github/scripts/update_schedule.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,33 @@ def parse_field(body: str, label: str) -> str:
6262
return match.group(1).strip()
6363

6464

65+
_MONTHS = (
66+
"January|February|March|April|May|June|"
67+
"July|August|September|October|November|December"
68+
)
69+
70+
71+
def parse_date_from_title(title: str) -> str:
72+
"""Try to extract a date string from an issue title."""
73+
# Bracketed MM-DD-YYYY e.g. [04-17-2026]
74+
m = re.search(r"\[(\d{1,2}-\d{1,2}-\d{4})\]", title)
75+
if m:
76+
return m.group(1)
77+
# Unbracketed MM-DD-YYYY
78+
m = re.search(r"(\d{1,2}-\d{1,2}-\d{4})", title)
79+
if m:
80+
return m.group(1)
81+
# "Month D, YYYY" or "Month DD YYYY"
82+
m = re.search(rf"({_MONTHS})\s+(\d{{1,2}}),?\s+(\d{{4}})", title)
83+
if m:
84+
return f"{m.group(1)} {m.group(2)}, {m.group(3)}"
85+
return ""
86+
87+
6588
def parse_date(raw: str) -> datetime | None:
6689
"""Try common date formats found in the issues."""
6790
raw = raw.strip()
68-
for fmt in ("%m-%d-%Y", "%m/%d/%Y", "%-m-%-d-%Y"):
91+
for fmt in ("%m-%d-%Y", "%m/%d/%Y", "%B %d, %Y", "%B %-d, %Y"):
6992
try:
7093
return datetime.strptime(raw, fmt)
7194
except ValueError:
@@ -83,13 +106,27 @@ def parse_date(raw: str) -> datetime | None:
83106

84107
def build_row(issue: dict) -> dict | None:
85108
body = issue.get("body") or ""
109+
title = issue.get("title") or ""
86110
number = issue["number"]
87111
url = issue["html_url"]
88112

89113
guest_name = parse_field(body, "Name")
90114
raw_date = parse_field(body, "Dates")
91115
project = parse_field(body, "Project Name")
92116

117+
# Fall back to extracting date from the issue title for manually-created issues
118+
if not raw_date or raw_date.upper() in ("TBD", "_NO RESPONSE_", "NOT YET", ""):
119+
raw_date = parse_date_from_title(title)
120+
121+
# For manually-created issues the guest name may be in the title
122+
# e.g. "Open Source Friday - Guest Name - MM-DD-YYYY"
123+
if not guest_name:
124+
parts = [p.strip() for p in re.split(r"\s+-\s+", title)]
125+
# Remove the leading "Open Source Friday..." segment and trailing date segment
126+
candidates = [p for p in parts[1:] if not re.search(r"\d{4}", p)]
127+
if candidates:
128+
guest_name = candidates[0]
129+
93130
# Skip issues where the date is clearly TBD / not set
94131
if not raw_date or raw_date.upper() in ("TBD", "_NO RESPONSE_", "NOT YET"):
95132
print(f" Skipping #{number}: date is '{raw_date}'")

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ Don't miss this chance to explore the world of Open Source every Friday. We're l
1717
| ---- | ----- | ------- | ---- |
1818
| April 17, 2026 | [Gunnar Morling](https://github.com/githubevents/open-source-friday/issues/205) | Hardwood | brunoborges |
1919
| April 24, 2026 | [Teja Kummarikuntla](https://github.com/githubevents/open-source-friday/issues/211) | Kong | Andrea Griffiths |
20+
| May 1, 2026 | [Nicholas Tindle](https://github.com/githubevents/open-source-friday/issues/212) | TBD | Andrea Griffiths |
2021
| May 1, 2026 | [Jonny Burger](https://github.com/githubevents/open-source-friday/issues/210) | Remotion | Kedasha Kerr |
22+
| May 29, 2026 | [elvis kahoro](https://github.com/githubevents/open-source-friday/issues/201) | dlt | TBD |
2123
<!-- SCHEDULE_END -->

0 commit comments

Comments
 (0)