mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-14 05:03:49 +08:00
35 lines
1.3 KiB
Java
35 lines
1.3 KiB
Java
name: Copilot Issue Auto Comment
|
||
|
||
on:
|
||
issues:
|
||
types: [opened]
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
issues: write
|
||
|
||
jobs:
|
||
copilot_auto_comment:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Ask Copilot to triage issue automatically
|
||
uses: actions/github-script@v7
|
||
with:
|
||
script: |
|
||
const issue = context.payload.issue;
|
||
if (!issue) return;
|
||
|
||
const owner = context.repo.owner;
|
||
const repo = context.repo.repo;
|
||
|
||
const body = `@copilot 请自动分诊并直接给出可执行建议(无需人工先介入):\n\n- 先判断类型:Bug / Performance / Security / Question / Feature\n- 检查 Issue 信息是否完整(版本、部署方式、复现步骤、日志)\n- 若信息不完整:请直接按模板列出缺失项并引导补充\n- 若信息较完整:请给出下一步排查建议与最小复现建议\n- 若判断为已知问题或已修复:请给出对应版本/修复方向\n\nIssue #${issue.number}\n标题:${issue.title}\n链接:${issue.html_url}`;
|
||
|
||
await github.rest.issues.createComment({
|
||
owner,
|
||
repo,
|
||
issue_number: issue.number,
|
||
body,
|
||
});
|
||
|
||
core.info(`Copilot prompt comment posted to #${issue.number}`);
|