diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-29 10:52:50 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-29 10:52:50 +0300 |
| commit | 714e81e56b3e8d49359c8098ec85dbaac8f74d4c (patch) | |
| tree | 9e91ca8cf643449a5a7edca3a4606afe024c6e26 /internal/github/github.go | |
| parent | 4513ccec70871532b5b06aed3f9ed720abf613ed (diff) | |
refactor(cli): inject repo client factory for mq
Diffstat (limited to 'internal/github/github.go')
| -rw-r--r-- | internal/github/github.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 == "" { |
