chore(ci): harden similar-issues workflow with least-privilege split#1600
Conversation
decision(architecture): split into a read-only find job and a separate no-AI comment job, mirroring the triage workflow, so the step that reads issue content holds no write token and no shell access. decision(find-tools): disable Bash/Edit/Write/MultiEdit/NotebookEdit/WebFetch/WebSearch/Task and return related issue numbers via --json-schema structured output. Pass the untrusted issue title to gh search after "--" so it cannot be parsed as an option. decision(comment): build the comment from a fixed template, validate the model-chosen numbers against real repository issues, and render only the issue reference (#n) so no attacker-controlled text reaches the posted comment.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe workflow governing "find similar issues" is refactored to enforce a least-privilege, two-phase approach. The ChangesWorkflow refactor to two-phase architecture
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Performance Benchmark
Details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1600 +/- ##
=======================================
Coverage 90.86% 90.86%
=======================================
Files 121 121
Lines 4683 4683
Branches 1088 1088
=======================================
Hits 4255 4255
Misses 428 428 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Deploying repomix with
|
| Latest commit: |
5307a43
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a499f38d.repomix.pages.dev |
| Branch Preview URL: | https://chore-harden-issue-similar-w.repomix.pages.dev |
Summary
Apply the same least-privilege split used for the issue triage workflow (#1598) to the Claude similar-issues workflow.
find(read-only, no write token, no shell/network tools): reads the issue and a candidate pool fetched with plain gh, and returns up to 3 related issue numbers via--json-schemastructured output.comment(no AI): validates the chosen numbers against real repository issues and posts a fixed-template "Related Issues" comment that links only the issue references (#n).Checklist
npm run testnpm run lint