zhizhi/.github/workflows/zhuyuan-issue-reply.yml

48 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 铸渊 · Issue 自动回复
on:
issues:
types: [opened]
issue_comment:
types: [created]
jobs:
auto-reply:
name: 🤖 铸渊回答问题
runs-on: ubuntu-latest
# 仅在 Issue 新建或评论中包含 @铸渊 / 铸渊 时触发
# 排除 SYSLOG 提交(由 syslog-issue-pipeline.yml 处理)和 bingshuo-deploy由 bingshuo-deploy-agent.yml 处理)
if: >
(github.event_name == 'issues' &&
!contains(join(github.event.issue.labels.*.name, ','), 'syslog') &&
!contains(join(github.event.issue.labels.*.name, ','), 'bingshuo-deploy') &&
!contains(github.event.issue.title, 'SYSLOG') &&
!contains(github.event.issue.title, '系统日志') &&
!contains(github.event.issue.body, '### 广播编号')) ||
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '铸渊'))
permissions:
issues: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 铸渊处理Issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YUNWU_API_KEY: ${{ secrets.YUNWU_API_KEY }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_LABELS: ${{ join(github.event.issue.labels.*.name, ',') }}
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
COMMENT_ID: ${{ github.event.comment.id }}
EVENT_NAME: ${{ github.event_name }}
run: node scripts/zhuyuan-issue-reply.js