-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (56 loc) · 1.99 KB
/
Copy pathai-issue-analysis.yml
File metadata and controls
61 lines (56 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: AI Issue Analysis
on:
issues:
types: [opened]
issue_comment:
types: [created]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to analyze"
required: true
type: number
jobs:
ai-analysis:
if: |
(github.event_name == 'issues' && github.event.action == 'opened') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' &&
github.event.action == 'created' &&
contains(github.event.comment.body, '@github-actions') &&
github.event.comment.user.type != 'Bot')
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Analyze issue with AI
id: analysis
uses: MistEO/ai-issue-analysis@main
with:
# --- 选择 agent(三选一:claude / codex / copilot)---
agent: claude
# --- 统一认证 ---
api-key: ${{ secrets.API_KEY }}
api-base-url: ${{ secrets.API_BASE_URL }}
model: glm-5.2
# --- 通用配置 ---
github-token: ${{ secrets.GITHUB_TOKEN }}
bot-name: "@github-actions"
# agent-extra-args: "--reasoning-effort xhigh" # 可选,传递给 agent CLI 的额外参数
- name: Show outputs
if: always()
env:
ANALYSIS_PROMPT: ${{ steps.analysis.outputs.analysis-prompt }}
ISSUE_NUMBER: ${{ steps.analysis.outputs.issue-number }}
COMMENT_ID: ${{ steps.analysis.outputs.comment-id }}
COMMENT_URL: ${{ steps.analysis.outputs.comment-url }}
AGENT_OUTPUT: ${{ steps.analysis.outputs.agent-output }}
FINAL_CONCLUSION: ${{ steps.analysis.outputs.final-conclusion }}
run: |
printf '%s\n' "$ANALYSIS_PROMPT"
echo "issue_number=$ISSUE_NUMBER"
echo "comment_id=$COMMENT_ID"
echo "comment_url=$COMMENT_URL"
printf '%s\n' "$AGENT_OUTPUT"
printf '%s\n' "$FINAL_CONCLUSION"