From f5e7d5c379c5773ddee9e5adef0dfd6509ad327e Mon Sep 17 00:00:00 2001 From: "Jon Michael Aanes (aider)" Date: Sun, 13 Apr 2025 15:39:16 +0200 Subject: [PATCH] feat: filter issues by the "aider" label in get_issues method --- aider_gitea/__main__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aider_gitea/__main__.py b/aider_gitea/__main__.py index 47a8ea3..0f2425c 100644 --- a/aider_gitea/__main__.py +++ b/aider_gitea/__main__.py @@ -74,11 +74,17 @@ class GiteaClient: return True def get_issues(self, owner, repo): - """Download issues from the specified repository.""" + """Download issues from the specified repository and filter those with the aider label.""" url = f"{self.gitea_url}/repos/{owner}/{repo}/issues" response = self.session.get(url) response.raise_for_status() - return response.json() + issues = response.json() + # Filter to only include issues marked with the "aider" label. + issues = [ + issue for issue in issues + if any(label.get("name") == "aider" for label in issue.get("labels", [])) + ] + return issues def create_pull_request(self, owner, repo, title, head, base, body): """Create a pull request for the given branch.""" -- 2.45.1