mirror of
https://github.com/HuLaSpark/HuLa.git
synced 2026-09-24 23:11:59 +08:00
feat(worker): ✨ 代理实现 (#232)
* feat(worker): ✨ 代理实现 197 #197 * fix(worker): 🐛 修复localStorage未初始化访问异常 * fix(worker): 🐛 api代理和websocket代理设置分开 * fix(worker): 🐛 修复保存代理设置,重启异常bug * style(view): 💄 美化n-tabs白色下划线 * ci(PR-Boot): 🎡 修改pr-boot的key配置 --------- Co-authored-by: Dawn <2439646234@qq.com>
This commit is contained in:
@@ -83,10 +83,8 @@ jobs:
|
||||
const OpenAI = require('openai');
|
||||
|
||||
const openai = new OpenAI({
|
||||
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||
defaultHeaders: {
|
||||
'Authorization': `Bearer ${process.env.DASHSCOPE_API_KEY}`
|
||||
}
|
||||
apiKey: process.env.DASHSCOPE_API_KEY,
|
||||
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
||||
});
|
||||
|
||||
const diff = process.env.DIFF;
|
||||
@@ -118,31 +116,15 @@ jobs:
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `## PR 代码分析
|
||||
body: `
|
||||
PR 代码分析
|
||||
|
||||
${analysis}
|
||||
|
||||
---
|
||||
*这是由通义千问 AI 自动生成的 PR 分析,仅供参考。*`
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('API 调用失败:', error);
|
||||
core.setFailed(`PR 分析失败: ${error.message}`);
|
||||
|
||||
// 在 PR 中添加错误信息
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `## PR 代码分析失败
|
||||
|
||||
很抱歉,在分析过程中遇到了错误:${error.message}
|
||||
|
||||
请检查 Action 日志以获取更多详细信息。
|
||||
|
||||
---
|
||||
*这是自动生成的错误通知。*`
|
||||
});
|
||||
core.setFailed(`分析失败: ${error.message}`);
|
||||
}
|
||||
|
||||
- name: Skip Analysis Comment
|
||||
|
||||
Reference in New Issue
Block a user