feat: guidelines

This commit is contained in:
u80864958
2026-02-13 18:20:57 +01:00
parent 2e12c39786
commit ef55295c4d
8 changed files with 241 additions and 67 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"log/slog"
"net/http"
"code.gitea.io/sdk/gitea"
"git.schreifuchs.ch/schreifuchs/pierre-bot/internal/pierre"
@@ -50,11 +51,14 @@ func (g *Adapter) AddComment(ctx context.Context, owner, repo string, prID int,
},
},
}
_, _, err := g.client.CreatePullReview(owner, repo, int64(prID), opts)
_, resp, err := g.client.CreatePullReview(owner, repo, int64(prID), opts)
if err != nil {
slog.Error("Gitea AddComment failed", "err", err)
return err
}
if resp != nil && resp.StatusCode != http.StatusCreated {
return fmt.Errorf("unexpected status %d creating comment", resp.StatusCode)
}
slog.Info("Gitea AddComment succeeded", "pr", prID)
return nil
}