This commit is contained in:
pavel 2026-05-15 00:01:40 +02:00
commit 8d9b05608f
5 changed files with 59 additions and 11 deletions

View file

@ -44,7 +44,10 @@ func (a *App) createForgejoRepo(ctx context.Context, name, description string, p
HTMLURL string `json:"html_url"`
}
if err := json.Unmarshal(respBody, &parsed); err != nil {
return "", nil
return "", fmt.Errorf("forgejo create repo parse failed: %w", err)
}
if strings.TrimSpace(parsed.HTMLURL) == "" {
return "", errors.New("forgejo create repo response missing html_url")
}
return parsed.HTMLURL, nil
}