Skip to content

Commit 262c4eb

Browse files
authored
chore: 增加issue自动回复 (#2110)
1 parent f07bc43 commit 262c4eb

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.github/workflows/issue-automated .yml renamed to .github/workflows/issue-automated.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,15 @@ jobs:
2828
node-version: 20
2929

3030
- name: Install dependencies
31-
run: npm install node-fetch@2
31+
run: npm install openai @antv/mcp-server-antv
3232

3333
- name: Process Issue
3434
uses: actions/github-script@v7
35-
env:
36-
MCP_API_KEY: ${{ secrets.MCP_API_KEY }}
3735
with:
3836
github-token: ${{ secrets.GITHUB_TOKEN }}
3937
script: |
4038
let issue = context.payload.issue;
4139
42-
// 如果是手动触发,获取issue信息
4340
if (context.eventName === 'workflow_dispatch') {
4441
const issueNumber = context.payload.inputs.issue_number;
4542
const { data: issueData } = await github.rest.issues.get({
@@ -50,10 +47,10 @@ jobs:
5047
issue = issueData;
5148
}
5249
53-
// 运行脚本处理issue
5450
const script = require('./.github/workflows/scripts/issue-automated.js');
5551
await script({
5652
github,
5753
core,
58-
context
54+
context,
55+
issue
5956
});

.github/workflows/scripts/issue-automated.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ const { QueryAntVDocumentTool, ExtractAntVTopicTool }= require('@antv/mcp-serve
88
* @param {import('@actions/core')} param.core
99
* @param {Object} param.context GitHub Action context
1010
*/
11-
module.exports = async ({ github, core, context }) => {
11+
module.exports = async ({ github, core, context, issue }) => {
1212
try {
1313
core.info('开始处理 issue...');
14-
const issue = context.payload.issue;
1514
const library = `${context.repo.repo}`
1615
if (!issue) {
1716
core.setFailed('找不到 issue 信息');

0 commit comments

Comments
 (0)