Skip to content

Commit

Permalink
update action (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
anc95 authored May 27, 2023
1 parent 7e4b4be commit 2696379
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions action/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -148196,8 +148196,9 @@ const robot = (app) => {
base: commits[commits.length - 2].sha,
head: commits[commits.length - 1].sha,
});
const ignoreList = (process.env.IGNORE || process.env.ignore || '').split('\n').filter(v => v !== '');
const filesNames = files?.map((file) => file.filename) || [];
changedFiles = changedFiles?.filter((file) => filesNames.includes(file.filename));
changedFiles = changedFiles?.filter((file) => filesNames.includes(file.filename) && !ignoreList.includes(file.filename));
}
if (!changedFiles?.length) {
console.log('no target label attached');
Expand Down Expand Up @@ -148250,6 +148251,7 @@ class Chat {
constructor(apikey) {
this.chatAPI = new chatgpt_1.ChatGPTAPI({
apiKey: apikey,
apiBaseUrl: process.env.OPENAI_API_ENDPOINT || 'https://api.openai.com/v1',
completionParams: {
model: process.env.MODEL || 'gpt-3.5-turbo',
temperature: +(process.env.temperature || 0) || 1,
Expand All @@ -148262,7 +148264,7 @@ class Chat {
? `Answer me in ${process.env.LANGUAGE},`
: '';
const prompt = process.env.PROMPT ||
'Bellow is the code patch, please help me do a brief code review, if any bug risk and improvement suggestion are welcome';
'Below is a code patch, please help me do a brief code review on it. Any bug risks and/or improvement suggestions are welcome:';
return `${prompt}, ${answerLanguage}:
${patch}
`;
Expand Down

0 comments on commit 2696379

Please sign in to comment.