diff --git a/cheddahbot/tools/press_release.py b/cheddahbot/tools/press_release.py index 64b19e5..061d649 100644 --- a/cheddahbot/tools/press_release.py +++ b/cheddahbot/tools/press_release.py @@ -684,18 +684,27 @@ def write_press_releases( # ── ClickUp: upload docx attachments + comment ───────────────────── uploaded_count = 0 + failed_uploads: list[str] = [] if clickup_task_id and cu_client: try: for path in docx_files: if cu_client.upload_attachment(clickup_task_id, path): uploaded_count += 1 else: + failed_uploads.append(path) log.warning("ClickUp: failed to upload %s for task %s", path, clickup_task_id) + upload_warning = "" + if failed_uploads: + paths_list = "\n".join(f" - {p}" for p in failed_uploads) + upload_warning = ( + f"\n⚠️ Warning: {len(failed_uploads)} attachment(s) failed to upload. " + f"Files saved locally at:\n{paths_list}" + ) cu_client.add_comment( clickup_task_id, f"📎 Saved {len(docx_files)} press release(s). " f"{uploaded_count} file(s) attached.\n" - f"Generating JSON-LD schemas next...", + f"Generating JSON-LD schemas next...{upload_warning}", ) log.info( "ClickUp: uploaded %d attachments for task %s", uploaded_count, clickup_task_id