fix(github): add explicit GET method to gh api comment fetches (#294)

The gh api command defaults to POST for comment endpoints, causing
GitHub to reject the 'since' query parameter as an invalid POST body
field. Adding --method GET explicitly forces a GET request, allowing
the since parameter to work correctly for fetching comments.

This completes the fix started in f1cc5a09 which only changed from
-f flag to query string syntax but didn't address the HTTP method.
This commit is contained in:
Andy
2025-12-26 09:24:01 +01:00
committed by GitHub
parent 8bb3df917e
commit 217249c8a3
+2 -2
View File
@@ -667,7 +667,7 @@ class GHClient:
# Fetch inline review comments
# Use query string syntax - the -f flag sends POST body fields, not query params
review_endpoint = f"repos/{{owner}}/{{repo}}/pulls/{pr_number}/comments?since={since_timestamp}"
review_args = ["api", review_endpoint]
review_args = ["api", "--method", "GET", review_endpoint]
review_result = await self.run(review_args, raise_on_error=False)
review_comments = []
@@ -680,7 +680,7 @@ class GHClient:
# Fetch general issue comments
# Use query string syntax - the -f flag sends POST body fields, not query params
issue_endpoint = f"repos/{{owner}}/{{repo}}/issues/{pr_number}/comments?since={since_timestamp}"
issue_args = ["api", issue_endpoint]
issue_args = ["api", "--method", "GET", issue_endpoint]
issue_result = await self.run(issue_args, raise_on_error=False)
issue_comments = []