summaryrefslogtreecommitdiff
path: root/internal/github/github.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/github/github.go')
-rw-r--r--internal/github/github.go10
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 == "" {