Skip to content

Commit 2696379

Browse files
authored
update action (#100)
1 parent 7e4b4be commit 2696379

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

action/index.cjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148196,8 +148196,9 @@ const robot = (app) => {
148196148196
base: commits[commits.length - 2].sha,
148197148197
head: commits[commits.length - 1].sha,
148198148198
});
148199+
const ignoreList = (process.env.IGNORE || process.env.ignore || '').split('\n').filter(v => v !== '');
148199148200
const filesNames = files?.map((file) => file.filename) || [];
148200-
changedFiles = changedFiles?.filter((file) => filesNames.includes(file.filename));
148201+
changedFiles = changedFiles?.filter((file) => filesNames.includes(file.filename) && !ignoreList.includes(file.filename));
148201148202
}
148202148203
if (!changedFiles?.length) {
148203148204
console.log('no target label attached');
@@ -148250,6 +148251,7 @@ class Chat {
148250148251
constructor(apikey) {
148251148252
this.chatAPI = new chatgpt_1.ChatGPTAPI({
148252148253
apiKey: apikey,
148254+
apiBaseUrl: process.env.OPENAI_API_ENDPOINT || 'https://api.openai.com/v1',
148253148255
completionParams: {
148254148256
model: process.env.MODEL || 'gpt-3.5-turbo',
148255148257
temperature: +(process.env.temperature || 0) || 1,
@@ -148262,7 +148264,7 @@ class Chat {
148262148264
? `Answer me in ${process.env.LANGUAGE},`
148263148265
: '';
148264148266
const prompt = process.env.PROMPT ||
148265-
'Bellow is the code patch, please help me do a brief code review, if any bug risk and improvement suggestion are welcome';
148267+
'Below is a code patch, please help me do a brief code review on it. Any bug risks and/or improvement suggestions are welcome:';
148266148268
return `${prompt}, ${answerLanguage}:
148267148269
${patch}
148268148270
`;

0 commit comments

Comments
 (0)