From 714e81e56b3e8d49359c8098ec85dbaac8f74d4c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 29 May 2026 10:52:50 +0300 Subject: refactor(cli): inject repo client factory for mq --- internal/github/github.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/github/github.go') diff --git a/internal/github/github.go b/internal/github/github.go index e48fc50..66e0f67 100644 --- a/internal/github/github.go +++ b/internal/github/github.go @@ -21,6 +21,7 @@ type Client struct { } var _ forge.RepoClient = (*Client)(nil) +var _ forge.RepoDescriptionClient = (*Client)(nil) // NewClient creates a new GitHub API client func NewClient(token, org string) *Client { @@ -231,6 +232,15 @@ func (c *Client) GetRepo(repoName string) (Repository, bool, error) { return repo, true, nil } +// GetRepoDescription fetches a repository description. +func (c *Client) GetRepoDescription(repoName string) (string, bool, error) { + repo, exists, err := c.GetRepo(repoName) + if err != nil || !exists { + return "", exists, err + } + return strings.TrimSpace(repo.Description), true, nil +} + // UpdateRepoDescription updates the repository description func (c *Client) UpdateRepoDescription(repoName, description string) error { if c.token == "" { -- cgit v1.2.3