mirror of
https://github.com/pacnpal/Claude-code-review.git
synced 2025-12-20 12:11:09 -05:00
Compare commits
5 Commits
v1.0.8
...
47ead35362
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47ead35362 | ||
|
|
785bb103c6 | ||
|
|
d45693ae1c | ||
|
|
a9173964c2 | ||
|
|
acd58d30ee |
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -27,8 +27,8 @@ jobs:
|
||||
|
||||
- name: Commit built files
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
git config --global user.name 'claude-code-review[bot]'
|
||||
git config --global user.email 'claude-code-review[bot]@users.noreply.github.com'
|
||||
git add -f dist
|
||||
git commit -m 'Add built files'
|
||||
git push origin HEAD:main
|
||||
|
||||
@@ -33,6 +33,8 @@ async function setupGitConfig() {
|
||||
// Configure git to fetch PR refs
|
||||
await exec('git', ['config', '--local', '--add', 'remote.origin.fetch', '+refs/pull/*/head:refs/remotes/origin/pr/*']);
|
||||
await exec('git', ['fetch', 'origin']);
|
||||
await exec('git', ['config', '--global', 'user.name', 'claude-code-review[bot]']);
|
||||
await exec('git', ['config', '--global', 'user.email', 'claude-code-review[bot]@users.noreply.github.com']);
|
||||
}
|
||||
|
||||
async function getDiff(baseSha, headSha) {
|
||||
|
||||
25
dist/index.js
vendored
25
dist/index.js
vendored
@@ -31862,6 +31862,8 @@ async function setupGitConfig() {
|
||||
// Configure git to fetch PR refs
|
||||
await exec('git', ['config', '--local', '--add', 'remote.origin.fetch', '+refs/pull/*/head:refs/remotes/origin/pr/*']);
|
||||
await exec('git', ['fetch', 'origin']);
|
||||
await exec('git', ['config', '--global', 'user.name', 'claude-code-review[bot]']);
|
||||
await exec('git', ['config', '--global', 'user.email', 'claude-code-review[bot]@users.noreply.github.com']);
|
||||
}
|
||||
|
||||
async function getDiff(baseSha, headSha) {
|
||||
@@ -31877,26 +31879,7 @@ async function getDiff(baseSha, headSha) {
|
||||
}
|
||||
});
|
||||
|
||||
// Filter for relevant files
|
||||
const lines = diffContent.split('\n');
|
||||
let filtered = '';
|
||||
let keep = false;
|
||||
|
||||
for (const line of lines) {
|
||||
if (line.startsWith('diff --git')) {
|
||||
keep = false;
|
||||
// Check if file type should be included
|
||||
if (line.match(/\.(js|ts|py|cpp|h|java|cs)$/) &&
|
||||
!line.match(/(package-lock\.json|yarn\.lock|\.md|\.json)/)) {
|
||||
keep = true;
|
||||
}
|
||||
}
|
||||
if (keep) {
|
||||
filtered += line + '\n';
|
||||
}
|
||||
}
|
||||
|
||||
return filtered;
|
||||
return diffContent;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to generate diff: ${error.message}`);
|
||||
}
|
||||
@@ -31942,7 +31925,7 @@ ${diffContent}
|
||||
'anthropic-version': '2023-06-01'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: 'claude-3-sonnet-20240229',
|
||||
model: 'claude-3-5-sonnet-20241022',
|
||||
max_tokens: 4096,
|
||||
temperature: 0.7,
|
||||
messages: [{
|
||||
|
||||
Reference in New Issue
Block a user