Preview what a GitHub mirror would change on GitHub
GET/api/repos/{owner}/{repo}/mirrors/github/preview
previewGithubMirror
What a push mirror through the neosource GitHub App to `target` would do to GitHub right now: the refs it would delete, the refs it would force-update (with whether each update is a fast-forward), how many branches it would create or leave alone, and GitHub's default branch when the push keeps it rather than deleting it. Computed exactly as the mirror's push computes its command set, from this repository's current branches and GitHub's current refs. Writes nothing, here or on GitHub. Requires repo admin and a GitHub App installation you may use that reaches `target` with `contents` and `workflows` write — the same check `POST …/mirrors/github` makes, refused the same way: `403 github_app_install_required` (its `message` carries the fix) when no such installation covers it, or GitHub answers that it is uninstalled, suspended or no longer reaches `target`; `403 github_app_permission_missing` (body `GithubAppPermissionMissingError`) when one does without a mirror's permissions. `404` when this deployment has no GitHub App configured. Whether the mirror itself would be admitted (the same-target guard) is not answered here.
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/mirrors/github/preview?target=TARGET' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN'fetch
fetch("https://neosource.dev/api/repos/OWNER/REPO/mirrors/github/preview?target=TARGET", {
method: "GET",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
},
});Path parameters
ownerrequiredRepository owner or organization slug.
reporequiredRepository name.
Query parameters
targetrequiredThe GitHub `owner/name` a mirror would push to.
Responses
200What the mirror's push would do
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 403Forbidden — one of: forbidden, github_app_install_required, github_app_permission_missing
- 404Not Found — one of: not_found
- 423Locked — one of: busy
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 502Bad Gateway — one of: upstream
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget