[PR #41] [MERGED] [fix] Correct GitHub PR review comments API syntax #42

Closed
opened 2026-10-26 22:07:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-claude-prompt-library/pull/41
Author: @christian-byrne
Created: 7/24/2025
Status: ✅ Merged
Merged: 7/25/2025
Merged by: @christian-byrne

Base: master ← Head: fix/github-pr-review-comments-api


📝 Commits (1)

  • 5990770 [fix] Correct GitHub PR review comments API syntax

📊 Changes

1 file changed (+115 additions, -80 deletions)

View changed files

📝 .claude/commands/github/GH-PR-add-review-comments-to-pr.md (+115 -80)

📄 Description

Summary

Fixes incorrect GitHub API usage in the PR review comments command that would cause API calls to fail.

Key Changes

  • Fixed non-existent endpoint: Replaced /pulls/{pr}/reviews/{review_id}/comments (which doesn't exist) with correct /pulls/{pr}/comments
  • Added required headers: Accept: application/vnd.github+json and X-GitHub-Api-Version: 2022-11-28
  • Fixed parameter syntax: Use -f for string parameters, -F for numeric parameters
  • Added multi-line comment support: Examples with start_line/start_side parameters
  • Clarified API separation: Reviews and inline comments are separate operations

Before/After

Before (incorrect):

gh api -X POST /repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments \
  -f path="file.ts" -f line=42 -f body="comment"

After (correct):

gh api --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments \
  -f body="comment" -f commit_id="$COMMIT_SHA" \
  -f path="file.ts" -F line=42 -f side="RIGHT"

The command now matches the exact syntax from GitHub's official documentation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-claude-prompt-library/pull/41 **Author:** [@christian-byrne](https://github.com/christian-byrne) **Created:** 7/24/2025 **Status:** ✅ Merged **Merged:** 7/25/2025 **Merged by:** [@christian-byrne](https://github.com/christian-byrne) **Base:** `master` ← **Head:** `fix/github-pr-review-comments-api` --- ### 📝 Commits (1) - [`5990770`](https://github.com/Comfy-Org/comfy-claude-prompt-library/commit/59907700130d4992729405dc89ef628067eac918) [fix] Correct GitHub PR review comments API syntax ### 📊 Changes **1 file changed** (+115 additions, -80 deletions) <details> <summary>View changed files</summary> 📝 `.claude/commands/github/GH-PR-add-review-comments-to-pr.md` (+115 -80) </details> ### 📄 Description ## Summary Fixes incorrect GitHub API usage in the PR review comments command that would cause API calls to fail. ## Key Changes - **Fixed non-existent endpoint**: Replaced `/pulls/{pr}/reviews/{review_id}/comments` (which doesn't exist) with correct `/pulls/{pr}/comments` - **Added required headers**: `Accept: application/vnd.github+json` and `X-GitHub-Api-Version: 2022-11-28` - **Fixed parameter syntax**: Use `-f` for string parameters, `-F` for numeric parameters - **Added multi-line comment support**: Examples with `start_line`/`start_side` parameters - **Clarified API separation**: Reviews and inline comments are separate operations ## Before/After **Before (incorrect):** ```bash gh api -X POST /repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments \ -f path="file.ts" -f line=42 -f body="comment" ``` **After (correct):** ```bash gh api --method POST \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments \ -f body="comment" -f commit_id="$COMMIT_SHA" \ -f path="file.ts" -F line=42 -f side="RIGHT" ``` The command now matches the exact syntax from GitHub's official documentation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:07:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-claude-prompt-library#42
No description provided.