mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
feat: add instant "Fix this" links to PR code reviews (#773)
* feat: add "Fix this" links to PR code reviews When Claude reviews PRs and identifies fixable issues, it now includes inline links that open Claude Code with the fix request pre-loaded. Format: [Fix this →](https://claude.ai/code?q=<URI_ENCODED_INSTRUCTIONS>&repo=<REPO>) This enables one-click fix requests directly from code review comments. * feat: add include_fix_links input to control Fix this links Adds a configurable input to enable/disable the "Fix this →" links in PR code reviews. Defaults to true for backwards compatibility.
This commit is contained in:
@@ -734,7 +734,13 @@ ${eventData.eventName === "issue_comment" || eventData.eventName === "pull_reque
|
||||
- Reference specific code sections with file paths and line numbers${eventData.isPR ? `\n - AFTER reading files and analyzing code, you MUST call mcp__github_comment__update_claude_comment to post your review` : ""}
|
||||
- Formulate a concise, technical, and helpful response based on the context.
|
||||
- Reference specific code with inline formatting or code blocks.
|
||||
- Include relevant file paths and line numbers when applicable.
|
||||
- Include relevant file paths and line numbers when applicable.${
|
||||
eventData.isPR && context.githubContext?.inputs.includeFixLinks
|
||||
? `
|
||||
- When identifying issues that could be fixed, include an inline link: [Fix this →](https://claude.ai/code?q=<URI_ENCODED_INSTRUCTIONS>&repo=${context.repository})
|
||||
The query should be URI-encoded and include enough context for Claude Code to understand and fix the issue (file path, line numbers, branch name, what needs to change).`
|
||||
: ""
|
||||
}
|
||||
- ${eventData.isPR ? `IMPORTANT: Submit your review feedback by updating the Claude comment using mcp__github_comment__update_claude_comment. This will be displayed as your PR review.` : `Remember that this feedback must be posted to the GitHub comment using mcp__github_comment__update_claude_comment.`}
|
||||
|
||||
B. For Straightforward Changes:
|
||||
|
||||
@@ -95,6 +95,7 @@ type BaseContext = {
|
||||
allowedBots: string;
|
||||
allowedNonWriteUsers: string;
|
||||
trackProgress: boolean;
|
||||
includeFixLinks: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -150,6 +151,7 @@ export function parseGitHubContext(): GitHubContext {
|
||||
allowedBots: process.env.ALLOWED_BOTS ?? "",
|
||||
allowedNonWriteUsers: process.env.ALLOWED_NON_WRITE_USERS ?? "",
|
||||
trackProgress: process.env.TRACK_PROGRESS === "true",
|
||||
includeFixLinks: process.env.INCLUDE_FIX_LINKS === "true",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user