diff --git a/scripts/sync_notion_to_forgejo.py b/scripts/sync_notion_to_forgejo.py index e3681e7..6441b17 100644 --- a/scripts/sync_notion_to_forgejo.py +++ b/scripts/sync_notion_to_forgejo.py @@ -29,7 +29,7 @@ LABEL_MAP = { STATUS_MAP = { "Open": "open", "In progress": "open", # + "In progress" label (id=4) - "Done": "closed", + "Done": "open", # stays open until Naomi ticks Verified } IN_PROGRESS_LABEL_ID = 4 @@ -69,6 +69,7 @@ def sync_item(item, existing): title = item["title"].strip() category = item.get("category") status = item.get("status", "Open") + verified = item.get("verified", False) notion_url = item["url"] has_screenshot = item.get("has_screenshot", False) @@ -79,13 +80,26 @@ def sync_item(item, existing): labels.append(IN_PROGRESS_LABEL_ID) screenshot_note = "\n\n📎 Screenshot attached in Notion" if has_screenshot else "" + + if status == "Done" and not verified: + verification_note = "\n\n⏳ *Awaiting Naomi's verification*" + elif status == "Done" and verified: + verification_note = "\n\n✅ *Verified by Naomi*" + else: + verification_note = "" + body = ( f"*Synced from [🌸 BloomBase Notion]({notion_url})*" f"{screenshot_note}" + f"{verification_note}" f"\n\n" ) - state = STATUS_MAP.get(status, "open") + # Only close the Forgejo issue once Naomi has verified + if status == "Done" and verified: + state = "closed" + else: + state = STATUS_MAP.get(status, "open") if notion_id in existing: issue_num = existing[notion_id]