properly sync closed issues
All checks were successful
Sync Beads to Gitea Issues / sync-beads (push) Successful in 7s

This commit is contained in:
Rootiest 2026-01-19 21:31:34 -05:00
parent 39c0aaf630
commit e210607a1c
Signed by: rootiest
GPG Key ID: 623CE33E5CF323D5

View File

@ -61,17 +61,22 @@ def sync():
continue continue
processed_count += 1 processed_count += 1
# Normalize the state for Gitea
# Beads can use 'closed', 'done', or 'finished'
is_closed = status in ["closed", "done", "finished"]
gitea_state = "closed" if is_closed else "open"
unique_title = f"[{bid}] {title}" unique_title = f"[{bid}] {title}"
payload = { payload = {
"title": unique_title, "title": unique_title,
"body": f"{data.get('description', 'No description provided.')}\n\n---\n**Beads ID:** `{bid}`\n**Type:** `{itype}`", "body": f"{data.get('description', 'No description provided.')}\n\n---\n**Beads ID:** `{bid}`\n**Type:** `{itype}`",
"state": "closed" "state": gitea_state, # Use the normalized variable here
if status in ["closed", "done"]
else "open",
} }
if bid in existing: if bid in existing:
print(f"✅ Updating Gitea Issue #{existing[bid]['number']} for {bid}") print(
f"✅ Updating Gitea Issue #{existing[bid]['number']} for {bid}"
)
requests.patch( requests.patch(
f"{URL}/api/v1/repos/{REPO}/issues/{existing[bid]['number']}", f"{URL}/api/v1/repos/{REPO}/issues/{existing[bid]['number']}",
headers=HEADERS, headers=HEADERS,