Skip to content

Commit 1cdd301

Browse files
authored
Merge pull request #12 from Nayjest/pr14
Pr14
2 parents 3948bbe + 9070deb commit 1cdd301

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/cr.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,38 @@ jobs:
6262
MAX_COMMENT_BYTES: "65000"
6363
with:
6464
script: |
65-
const fs = require('fs');
65+
const fs = require('fs');
6666
const path = require('path');
67-
67+
6868
const DIR = 'reviewer/storage/out';
6969
if (!fs.existsSync(DIR)) {
7070
core.info('No review output produced.');
7171
return;
7272
}
73-
73+
7474
let body = '## 🤖 GPT-4 Code Review\n\n';
75-
76-
// ── iterate entries & ignore directories ──
75+
7776
for (const entry of fs.readdirSync(DIR, { withFileTypes: true })) {
78-
if (entry.isDirectory()) continue; // ← skip folders
77+
if (entry.isDirectory()) continue; // skip folders
7978
const filePath = path.join(DIR, entry.name);
8079
let text = fs.readFileSync(filePath, 'utf8');
81-
80+
8281
if (text.length > +process.env.MAX_COMMENT_BYTES) {
8382
text = text.slice(0, +process.env.MAX_COMMENT_BYTES) + '\n…(truncated)…';
8483
}
85-
84+
8685
const title = entry.name.replace(/\.txt$/, '');
8786
body += `### ${title}\n\`\`\`\n${text}\n\`\`\`\n`;
8887
}
89-
90-
if (body.trim() === '## 🤖 GPT-4 Code Review') {
88+
89+
if (body.trim() === '## 🤖 AI Code Review') {
9190
core.info('Review output directory contains no files.');
9291
return;
9392
}
94-
95-
await github.rest.issues.createComment({ ...context.issue, body });
93+
94+
await github.rest.issues.createComment({
95+
owner: context.repo.owner,
96+
repo: context.repo.repo,
97+
issue_number: context.issue.number, // ✅ correct param name
98+
body
99+
});

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ More information can be found in the [GitHub documentation](https://docs.github.
2222

2323
- One pull request per feature. If you want to do more than one thing, send multiple pull requests.
2424

25-
- Send coherent history. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
25+
- Send cohettrent history. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
2626

2727

2828
Run code formatter:

0 commit comments

Comments
 (0)