fix(ci): 修复 AI Issue Helper 的 MCP 配置和响应传递问题
This commit is contained in:
13
.github/workflows/ai-issue-helper.yml
vendored
13
.github/workflows/ai-issue-helper.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
|||||||
id: ai
|
id: ai
|
||||||
with:
|
with:
|
||||||
model: 'gpt-4o-mini'
|
model: 'gpt-4o-mini'
|
||||||
mcp: github
|
enable-github-mcp: true
|
||||||
system-prompt: |
|
system-prompt: |
|
||||||
你是 ECS Framework 项目的 AI 助手。
|
你是 ECS Framework 项目的 AI 助手。
|
||||||
|
|
||||||
@@ -99,20 +99,15 @@ jobs:
|
|||||||
请用中文友好地回复用户的问题。
|
请用中文友好地回复用户的问题。
|
||||||
prompt-file: prompt.txt
|
prompt-file: prompt.txt
|
||||||
|
|
||||||
- name: Save AI Response
|
|
||||||
run: |
|
|
||||||
echo "${{ steps.ai.outputs.response }}" > ai_response.txt
|
|
||||||
|
|
||||||
- name: Post AI Response
|
- name: Post AI Response
|
||||||
|
env:
|
||||||
|
AI_RESPONSE: ${{ steps.ai.outputs.response }}
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs');
|
|
||||||
const response = fs.readFileSync('ai_response.txt', 'utf8');
|
|
||||||
|
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
body: response
|
body: process.env.AI_RESPONSE
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user