Skip to content

feat: auto-reply Add GitHub Actions workflow for CodeRabbit suggestion replies apply on CodeRabbit suggestion comments#105

Merged
nitrocode merged 2 commits into
mainfrom
copilot/auto-commit-fixes-on-review
Apr 27, 2026
Merged

feat: auto-reply Add GitHub Actions workflow for CodeRabbit suggestion replies apply on CodeRabbit suggestion comments#105
nitrocode merged 2 commits into
mainfrom
copilot/auto-commit-fixes-on-review

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

Summary

Automates applying CodeRabbit inline suggestions on PRs. When CodeRabbit posts a review comment containing a suggestion block, the workflow immediately replies @coderabbit apply, triggering CodeRabbit's own apply mechanism — no diff parsing, no file manipulation, no fragility.

Changes

  • Add .github/workflows/coderabbit-auto-apply.yml — triggers on pull_request_review_comment: created; guards on user.login == 'coderabbit-ai[bot]' AND body contains ```suggestion; posts reply via pulls.createReplyForReviewComment

Agent Checklist

  • npm run test:ci passes (all unit tests green, coverage not decreased)
  • npm run build && npm run test:e2e passes (all E2E tests green)
  • No generated files committed (script.js, styles.css, *-data.js)
  • All dynamic innerHTML values pass through escHtml()
  • No DOM references introduced in death-clock-core.js
  • No new runtime npm packages added
  • GitHub Actions uses: pins use a full commit SHA + inline semver comment
  • PR title follows Conventional Commits (feat:, fix:, docs:, chore:, etc.)
  • project-stats.yaml updated if this session merges one or more PRs
  • Relevant entry added to docs/LEARNINGS.md (new pattern or lesson learned)

Summary by CodeRabbit

  • Chores
    • Added a GitHub Actions workflow that listens for new pull request review comments and automatically posts a reply when specific comment criteria are met. This automation replies on the same pull request and comment, streamlining how review-comment replies are created without changing any public APIs or exported code.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16249c8a-51a0-41a7-bf52-d93b3ef88866

📥 Commits

Reviewing files that changed from the base of the PR and between 8281118 and d502aea.

📒 Files selected for processing (1)
  • .github/workflows/coderabbit-auto-apply.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/coderabbit-auto-apply.yml

📝 Walkthrough

Walkthrough

Listen up. Adds a GitHub Actions workflow that replies @coderabbit apply to pull request review comments from coderabbitai[bot] when the comment body contains a fenced suggestion block, using actions/github-script and pull-requests: write permission to create the reply.

Changes

Cohort / File(s) Summary
GitHub Actions Automation
/.github/workflows/coderabbit-auto-apply.yml
New workflow triggered on pull_request_review_comment events authored by coderabbitai[bot] containing a fenced suggestion block. Runs an auto-apply job that uses actions/github-script to call pulls.createReplyForReviewComment and posts @coderabbit apply. Grants pull-requests: write permission.

Sequence Diagram(s)

sequenceDiagram
    participant Bot as "CodeRabbit Bot"
    participant GitHub as "GitHub (Event)"
    participant Actions as "GitHub Actions Runner"
    participant Script as "actions/github-script API"

    Bot->>GitHub: Post review comment with fenced ```suggestion``` block
    GitHub->>Actions: Trigger workflow on pull_request_review_comment
    Actions->>Script: Execute script -> calls pulls.createReplyForReviewComment(pr, comment_id, body)
    Script->>GitHub: Request to create reply comment
    GitHub->>Actions: Acknowledge reply created
    Actions->>GitHub: Workflow completes
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed PR description follows the template structure with Summary, Changes, and Agent Checklist sections, providing adequate context about the workflow addition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title Check ✅ Passed Title check skipped as CodeRabbit has written the PR title.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/auto-commit-fixes-on-review

Comment @coderabbitai help to get the list of available commands and usage tips.

@nitrocode nitrocode marked this pull request as ready for review April 27, 2026 03:30
@nitrocode nitrocode self-requested a review as a code owner April 27, 2026 03:30
@coderabbitai coderabbitai Bot changed the title feat: auto-reply @coderabbit apply on CodeRabbit suggestion comments feat: auto-reply Add GitHub Actions workflow for CodeRabbit suggestion replies apply on CodeRabbit suggestion comments Apr 27, 2026
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

👁️ PR Preview

🚀 Open Preview

Deployed from commit d502aea · Updates on every push to this PR
(Preview is removed automatically when the PR is closed.)

Screenshots

Desktop Mobile
Desktop Mobile

github-actions Bot added a commit that referenced this pull request Apr 27, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/coderabbit-auto-apply.yml:
- Around line 14-15: The condition checking the comment author uses the wrong
bot login string; update the workflow condition that compares
github.event.comment.user.login (and the contains check) to use
'coderabbitai[bot]' instead of 'coderabbit-ai[bot]' so the branch with
contains(github.event.comment.body, '```suggestion') can match and the job will
run.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a49ecfae-c34b-4b4b-bc3a-57f72b52e80c

📥 Commits

Reviewing files that changed from the base of the PR and between eb6fe3b and 8281118.

📒 Files selected for processing (1)
  • .github/workflows/coderabbit-auto-apply.yml

Comment thread .github/workflows/coderabbit-auto-apply.yml Outdated
Signed-off-by: RB <7775707+nitrocode@users.noreply.github.com>
@nitrocode nitrocode enabled auto-merge (squash) April 27, 2026 03:51
@nitrocode nitrocode merged commit a794491 into main Apr 27, 2026
9 of 10 checks passed
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
@nitrocode nitrocode deleted the copilot/auto-commit-fixes-on-review branch April 27, 2026 03:51
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants