From 2696379a4921ee9287c41d3ed14a4157839c1938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=AE=89?= Date: Sat, 27 May 2023 11:41:49 +0800 Subject: [PATCH] update action (#100) --- action/index.cjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action/index.cjs b/action/index.cjs index 9576fef..56e5ba7 100644 --- a/action/index.cjs +++ b/action/index.cjs @@ -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'); @@ -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, @@ -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} `;