---
title: "Relink milestones whose GitHub sync never landed (GET)"
method: GET
path: "/cron/github-sync-repair"
tags: ["Cron"]
---

# Relink milestones whose GitHub sync never landed (GET)

`GET /cron/github-sync-repair`

## Request

- Base URL: `https://api.apphandoff.com/api`
- URL: `https://api.apphandoff.com/api/cron/github-sync-repair`
- Auth: none required

Sweeps milestones left in github_sync_state pending or failed past their
next-attempt time and completes their GitHub link. Safe to run
repeatedly: an existing milestone with the same title is linked rather
than duplicated. Every run also re-runs the milestone auto-finish rule
(a milestone whose last open ticket closed while a GitHub send was in
flight finishes here) and closes on GitHub the milestones the database
finished on its own (HO-15440). Each GitHub call acts as the row's
persisted principal (the close falls back to the project owner); no
environment user is read.
Protected by CRON_SECRET via the x-cron-secret header.

## Response `200`

Sweep result

- object
  - `ok` boolean, required
  - `skipped` string
  - `milestones` object
    - `linked` integer
    - `created` integer
    - `failed` integer
    - `skipped` integer

## Other responses

- `401`: Missing or invalid CRON_SECRET

---

[API](https://skmtc.dev/apphandoff/apis/apphandoff-api.md) · [All operations](https://skmtc.dev/apphandoff/apis/apphandoff-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apphandoff/apis/apphandoff-api/revisions/9f138fe46d56?raw)
