Skip to content

feat: add issue and PR comment delete actions - #116

Merged
JounQin merged 1 commit into
mainfrom
feat/comment-delete
Nov 9, 2026
Merged

JounQin merged 1 commit into
mainfrom
feat/comment-delete

Conversation

@JounQin

@JounQin JounQin commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Complete the comment lifecycle with typed delete actions:

  • issue:comment-delete <commentId> — issues: write
  • pr:comment-delete <commentId> — pull_requests: write

Both DELETE repos/{owner}/{repo}/issues/comments/{commentId} through the catalog's fixed gh api path. A PR conversation comment is an issue comment in GitHub's API; each alias declares only its domain's write permission, mirroring the edit actions and pr:comment / issue:comment.

The catalog labels are issue comment-delete / pr comment-delete, so help and the generated README table are usable. Tests cover permissions, argv, and the README table. Full suite: 598 pass.

Summary by CodeRabbit

  • New Features
    • Added actions to delete comments on issues and pull requests.
    • The new actions require write permissions for the relevant issues or pull requests.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The action catalog adds issue:comment-delete and pr:comment-delete. Both send DELETE requests to the issue-comment endpoint. The README and tests cover permissions and request arguments.

Changes: Comment deletion

Layer / File(s) Summary
Define and expose comment deletion actions
packages/core/src/actions.ts, test/unit/actions.test.ts, README.md, .changeset/comment-delete.md
ApiSpec.method now accepts DELETE. The action catalog registers issue and pull request comment deletion actions with their respective write permissions. Tests cover the action names, permissions, app user, and issue-comment request arguments. The README lists the required permissions, and the changeset records a minor release.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ActionCatalog
  participant gh_api
  participant GitHubIssueComments
  ActionCatalog->>gh_api: Configure DELETE request for comment ID
  gh_api->>GitHubIssueComments: Send request to issue-comment endpoint
Loading

Possibly related PRs

Suggested reviewers: i1stg

Merge Risk: Minimal · up to d9ff9

This adds issue and PR comment delete actions with the expected write permissions and request arguments. No actionable merge-blocking risk was found.

Security architecture risk: Moderate · up to d9ff9

The new actions permit permanent comment deletion without checking whether the comment belongs to the issue or pull-request domain named by the action. Existing repository restrictions, narrowly scoped App tokens, and GitHub authorization limit the exposure; this is not an unrestricted deletion capability.

Retained concerns

  • Medium · security · observed: The new issue and PR deletion aliases use the same comment-ID endpoint without validating the comment's parent domain. The supplied verification establishes that either domain's write grant can authorize the endpoint, so the alias-specific permission declarations do not isolate destructive operations to the named domain. This extends an existing editing limitation to deletion, within repository and credential authorization limits.
Security review details

Security Blast Radius

  • inferred — A caller able to submit actions can select individual conversation-comment IDs for deletion within allowed repositories and the execution identity's GitHub authority. Repetition can affect multiple authorized comments across those repositories. The inspected path does not provide arbitrary endpoints, cross-repository path injection, or additional App permissions.

Security Findings and Attack Paths

  • observed — The retained authorization finding concerns caller-selected comment identity crossing the issue/PR naming boundary: both aliases dispatch the same DELETE endpoint without checking the comment's parent type. The supplied verification reports that either write permission is accepted. The new destructive operation is PR-introduced; the shared endpoint and missing parent check already existed for editing.

Trust Boundaries and Controls

  • observed — Repository allowlisting, catalog validation, and identity eligibility remain enforced before provider execution. The App path checks grants and mints repository- and permission-restricted tokens. The user path uses a configured personal token instead, leaving final object authorization to that identity and GitHub rather than narrowing it to the action's App-permission declaration.

Resilience and Maintainability Implications

  • observed — The runner reports process failure and timeout, terminates timed-out process groups, and removes its temporary home in a finally block. The provider attempts to revoke minted action tokens after execution and returns a warning if revocation fails. These cleanup controls do not establish whether an interrupted remote deletion completed.

Hardening Proposals

  • proposed — If issue/PR domain isolation is intended, resolve the selected comment's parent and enforce the named domain consistently in both execution paths before deletion. Validate this contract with cross-domain comment IDs and restricted installation grants.
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: add issue and PR comment delete actions" states the main change. The changeset adds issue:comment-delete and pr:comment-delete actions to the action catalog, with their permissions, R…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Title check

Explanation

The title "feat: add issue and PR comment delete actions" states the main change. The changeset adds issue:comment-delete and pr:comment-delete actions to the action catalog, with their permissions, README entries, and tests. The title is concise, specific, and follows conventional commit style. It does not describe anything absent from the changeset.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (2 skipped: 2 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: df08a005-2937-4c8e-95cb-e1a27e027c75
Commits

Reviewing files that changed from the base of the PR and between eee2074 and d9ff970.

Files selected for processing: 4

  • .changeset/comment-delete.md
  • README.md
  • packages/core/src/actions.ts
  • test/unit/actions.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@JounQin
JounQin added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 70eff30 Nov 9, 2026
7 checks passed
@JounQin
JounQin deleted the feat/comment-delete branch November 9, 2026 04:47
@github-actions github-actions Bot mentioned this pull request Nov 9, 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.

1 participant