mirror of
https://github.com/nickrunning/wechat-selkies.git
synced 2026-05-09 00:24:09 +00:00
ci: update issue templates
This commit is contained in:
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
||||||
138
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
138
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
name: 🐛 Bug Report
|
||||||
|
description: 创建一个错误报告来帮助我们改进项目
|
||||||
|
title: "[Bug]: "
|
||||||
|
labels: ["bug", "triage"]
|
||||||
|
assignees: []
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
感谢您花时间填写错误报告!请提供详细信息以帮助我们诊断问题。
|
||||||
|
|
||||||
|
> **注意**: 请确保标题和描述足够详细,以便我们能够理解和重现问题。
|
||||||
|
|
||||||
|
**标题要求**: 请在页面顶部的标题框中填写简洁明了的问题描述(最少10个字符),例如:"微信无法启动显示黑屏"
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: bug-description
|
||||||
|
attributes:
|
||||||
|
label: 错误描述
|
||||||
|
description: 清晰简洁地描述遇到的错误(最少30个字符)
|
||||||
|
placeholder: 详细描述您遇到的问题...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: reproduction-steps
|
||||||
|
attributes:
|
||||||
|
label: 重现步骤
|
||||||
|
description: 详细说明重现该错误的步骤(最少50个字符)
|
||||||
|
placeholder: |
|
||||||
|
1. 执行 '...'
|
||||||
|
2. 点击 '...'
|
||||||
|
3. 滚动到 '...'
|
||||||
|
4. 看到错误
|
||||||
|
value: |
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: expected-behavior
|
||||||
|
attributes:
|
||||||
|
label: 预期行为
|
||||||
|
description: 清楚简洁地描述您期望发生的情况
|
||||||
|
placeholder: 描述应该发生什么...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: screenshots
|
||||||
|
attributes:
|
||||||
|
label: 截图
|
||||||
|
description: 如果适用,请添加截图来帮助解释问题
|
||||||
|
placeholder: 拖放图片或粘贴图片链接
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: os
|
||||||
|
attributes:
|
||||||
|
label: 操作系统
|
||||||
|
description: 您使用的操作系统
|
||||||
|
options:
|
||||||
|
- Ubuntu 20.04
|
||||||
|
- Ubuntu 22.04
|
||||||
|
- Ubuntu 24.04
|
||||||
|
- Debian 11
|
||||||
|
- Debian 12
|
||||||
|
- CentOS 7
|
||||||
|
- CentOS 8
|
||||||
|
- Rocky Linux 8
|
||||||
|
- Rocky Linux 9
|
||||||
|
- Windows 10
|
||||||
|
- Windows 11
|
||||||
|
- macOS
|
||||||
|
- 其他(请在附加信息中说明)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: browser
|
||||||
|
attributes:
|
||||||
|
label: 浏览器
|
||||||
|
description: 您使用的浏览器
|
||||||
|
options:
|
||||||
|
- Chrome
|
||||||
|
- Firefox
|
||||||
|
- Safari
|
||||||
|
- Edge
|
||||||
|
- 其他(请在附加信息中说明)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: docker-version
|
||||||
|
attributes:
|
||||||
|
label: Docker版本
|
||||||
|
description: 运行 `docker --version` 的输出
|
||||||
|
placeholder: 例如:Docker version 24.0.6
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: compose-version
|
||||||
|
attributes:
|
||||||
|
label: Docker Compose版本
|
||||||
|
description: 运行 `docker-compose --version` 的输出
|
||||||
|
placeholder: 例如:docker-compose version 2.21.0
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: logs
|
||||||
|
attributes:
|
||||||
|
label: 相关日志
|
||||||
|
description: 请提供相关的容器日志或错误信息
|
||||||
|
placeholder: 粘贴 `docker logs <container-name>` 的输出
|
||||||
|
render: shell
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: additional-context
|
||||||
|
attributes:
|
||||||
|
label: 附加信息
|
||||||
|
description: 添加关于该问题的任何其他相关信息
|
||||||
|
placeholder: 任何可能有助于解决问题的额外信息...
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: terms
|
||||||
|
attributes:
|
||||||
|
label: 检查清单
|
||||||
|
description: 请确认以下事项
|
||||||
|
options:
|
||||||
|
- label: 我已经搜索了现有的issues,确认这不是重复问题
|
||||||
|
required: true
|
||||||
|
- label: 我已经阅读了README和相关文档
|
||||||
|
required: true
|
||||||
|
- label: 我提供的信息足够详细,可以帮助重现问题
|
||||||
|
required: true
|
||||||
14
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
14
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: 📖 项目文档
|
||||||
|
url: https://github.com/nickrunning/wechat-selkies/blob/master/README.md
|
||||||
|
about: 请先查看项目文档和常见问题解答
|
||||||
|
- name: 💬 讨论区 - 问答交流
|
||||||
|
url: https://github.com/nickrunning/wechat-selkies/discussions
|
||||||
|
about: 一般性问题、经验分享、想法讨论请使用讨论区
|
||||||
|
- name: 📋 讨论区使用指南
|
||||||
|
url: https://github.com/nickrunning/wechat-selkies/blob/master/.github/discussions-guide.md
|
||||||
|
about: 了解讨论区表单使用方法和最佳实践
|
||||||
|
- name: 🔍 搜索现有内容
|
||||||
|
url: https://github.com/nickrunning/wechat-selkies/search?type=discussions
|
||||||
|
about: 搜索现有的讨论和问题,避免重复提交
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
112
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
112
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
name: 🚀 Feature Request
|
||||||
|
description: 为这个项目建议一个新想法或功能
|
||||||
|
title: "[Feature]: "
|
||||||
|
labels: ["enhancement", "triage"]
|
||||||
|
assignees: []
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
感谢您提出功能建议!请提供详细信息以帮助我们理解您的需求。
|
||||||
|
|
||||||
|
> **注意**: 请确保标题和描述足够详细,以便我们能够理解您的功能需求。
|
||||||
|
|
||||||
|
**标题要求**: 请在页面顶部的标题框中填写简洁明了的功能描述(最少10个字符),例如:"添加微信多开功能支持"
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: problem-description
|
||||||
|
attributes:
|
||||||
|
label: 问题描述
|
||||||
|
description: 清楚简洁地描述您遇到的问题或需求(最少30个字符)
|
||||||
|
placeholder: 例如:我希望能够同时运行多个微信实例...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: solution-description
|
||||||
|
attributes:
|
||||||
|
label: 解决方案描述
|
||||||
|
description: 清楚简洁地描述您希望实现的功能(最少50个字符)
|
||||||
|
placeholder: 详细描述您期望的功能如何工作...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: alternatives-considered
|
||||||
|
attributes:
|
||||||
|
label: 考虑的替代方案
|
||||||
|
description: 清楚简洁地描述您考虑过的任何替代解决方案或功能
|
||||||
|
placeholder: 描述您考虑过的其他方法...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: feature-type
|
||||||
|
attributes:
|
||||||
|
label: 功能类型
|
||||||
|
description: 这个功能请求属于哪个类别?
|
||||||
|
options:
|
||||||
|
- 用户界面改进
|
||||||
|
- 性能优化
|
||||||
|
- 新功能
|
||||||
|
- 配置选项
|
||||||
|
- 文档改进
|
||||||
|
- 安全性增强
|
||||||
|
- 兼容性改进
|
||||||
|
- 其他
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: priority
|
||||||
|
attributes:
|
||||||
|
label: 优先级
|
||||||
|
description: 您认为这个功能的优先级如何?
|
||||||
|
options:
|
||||||
|
- 低 - 很有用,但不紧急
|
||||||
|
- 中 - 对工作流程有帮助
|
||||||
|
- 高 - 重要的功能缺失
|
||||||
|
- 紧急 - 阻塞性问题
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: use-cases
|
||||||
|
attributes:
|
||||||
|
label: 使用场景
|
||||||
|
description: 描述这个功能的具体使用场景和用户故事
|
||||||
|
placeholder: |
|
||||||
|
作为用户,我希望能够...
|
||||||
|
这样我就可以...
|
||||||
|
例如:...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: mockups
|
||||||
|
attributes:
|
||||||
|
label: 模拟图或截图
|
||||||
|
description: 如果适用,请添加模拟图、线框图或参考截图
|
||||||
|
placeholder: 拖放图片或粘贴图片链接
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: additional-context
|
||||||
|
attributes:
|
||||||
|
label: 附加信息
|
||||||
|
description: 添加关于功能请求的任何其他相关信息、链接或参考资料
|
||||||
|
placeholder: 任何可能有助于实现这个功能的额外信息...
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: terms
|
||||||
|
attributes:
|
||||||
|
label: 检查清单
|
||||||
|
description: 请确认以下事项
|
||||||
|
options:
|
||||||
|
- label: 我已经搜索了现有的issues,确认这不是重复的功能请求
|
||||||
|
required: true
|
||||||
|
- label: 我已经阅读了README和相关文档
|
||||||
|
required: true
|
||||||
|
- label: 这个功能请求与项目的目标和范围相符
|
||||||
|
required: true
|
||||||
|
- label: 我提供的描述足够详细,可以帮助理解功能需求
|
||||||
|
required: true
|
||||||
82
.github/ISSUE_TEMPLATE/general.yml
vendored
Normal file
82
.github/ISSUE_TEMPLATE/general.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
name: 📝 General Issue
|
||||||
|
description: 其他类型的问题或讨论
|
||||||
|
title: "[General]: "
|
||||||
|
labels: ["question", "triage"]
|
||||||
|
assignees: []
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
如果您的问题不符合Bug报告或功能请求的类别,请使用此模板。
|
||||||
|
|
||||||
|
> **提示**: 对于一般性讨论,考虑使用[讨论区](https://github.com/nickrunning/wechat-selkies/discussions)。
|
||||||
|
|
||||||
|
**标题要求**: 请在页面顶部的标题框中填写简洁明了的问题描述(最少10个字符),例如:"关于项目配置的问题"
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: issue-type
|
||||||
|
attributes:
|
||||||
|
label: 问题类型
|
||||||
|
description: 请选择最符合您问题的类型
|
||||||
|
options:
|
||||||
|
- 使用问题/疑问
|
||||||
|
- 配置相关
|
||||||
|
- 安装/部署问题
|
||||||
|
- 文档问题
|
||||||
|
- 兼容性问题
|
||||||
|
- 建议/反馈
|
||||||
|
- 其他
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: 详细描述
|
||||||
|
description: 详细描述您的问题或情况(最少30个字符)
|
||||||
|
placeholder: 请详细描述您遇到的情况、需要的帮助或想要讨论的内容...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: context
|
||||||
|
attributes:
|
||||||
|
label: 相关背景
|
||||||
|
description: 提供相关的背景信息或上下文
|
||||||
|
placeholder: |
|
||||||
|
- 您在尝试做什么?
|
||||||
|
- 您的使用场景是什么?
|
||||||
|
- 是否有相关的配置或设置?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: environment
|
||||||
|
attributes:
|
||||||
|
label: 环境信息
|
||||||
|
description: 如果相关,请提供环境信息
|
||||||
|
placeholder: |
|
||||||
|
- 操作系统:
|
||||||
|
- Docker版本:
|
||||||
|
- 浏览器:
|
||||||
|
- 其他相关信息:
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: additional-info
|
||||||
|
attributes:
|
||||||
|
label: 附加信息
|
||||||
|
description: 任何其他可能相关的信息、链接或截图
|
||||||
|
placeholder: 包括日志、配置文件、截图等...
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: checklist
|
||||||
|
attributes:
|
||||||
|
label: 检查清单
|
||||||
|
description: 请确认以下事项
|
||||||
|
options:
|
||||||
|
- label: 我已经搜索了现有的issues和讨论
|
||||||
|
required: true
|
||||||
|
- label: 我已经阅读了相关文档
|
||||||
|
required: true
|
||||||
|
- label: 我提供的信息足够详细
|
||||||
|
required: true
|
||||||
98
.github/workflows/cleanup-issues.yml
vendored
Normal file
98
.github/workflows/cleanup-issues.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
name: Close Invalid Issues
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# 每天运行一次,清理无效issues
|
||||||
|
- cron: '0 2 * * *'
|
||||||
|
workflow_dispatch: # 允许手动触发
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
close-invalid-issues:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Close stale issues with needs-more-info label
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { data: issues } = await github.rest.issues.listForRepo({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'open',
|
||||||
|
labels: 'needs-more-info',
|
||||||
|
sort: 'updated',
|
||||||
|
direction: 'asc'
|
||||||
|
});
|
||||||
|
|
||||||
|
const now = new Date();
|
||||||
|
const staleThreshold = 7 * 24 * 60 * 60 * 1000; // 7天
|
||||||
|
|
||||||
|
for (const issue of issues) {
|
||||||
|
const updatedAt = new Date(issue.updated_at);
|
||||||
|
const daysSinceUpdate = Math.floor((now - updatedAt) / (24 * 60 * 60 * 1000));
|
||||||
|
|
||||||
|
if (now - updatedAt > staleThreshold) {
|
||||||
|
console.log(`Closing stale issue #${issue.number} (${daysSinceUpdate} days old)`);
|
||||||
|
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `🤖 **自动关闭通知**\n\n这个issue已经标记为需要更多信息超过7天,且没有收到回复。为了保持issue列表的整洁,现在自动关闭此issue。\n\n如果您仍然遇到问题,请:\n1. 提供我们之前请求的信息\n2. 重新开启此issue或创建新的issue\n\n我们随时欢迎您提供更多详细信息!`
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.update({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
state: 'closed',
|
||||||
|
state_reason: 'not_planned'
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: ['auto-closed']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Add warning to old issues without labels
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { data: issues } = await github.rest.issues.listForRepo({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'open',
|
||||||
|
sort: 'created',
|
||||||
|
direction: 'asc'
|
||||||
|
});
|
||||||
|
|
||||||
|
const now = new Date();
|
||||||
|
const oldThreshold = 3 * 24 * 60 * 60 * 1000; // 3天
|
||||||
|
|
||||||
|
for (const issue of issues) {
|
||||||
|
const createdAt = new Date(issue.created_at);
|
||||||
|
const isOld = now - createdAt > oldThreshold;
|
||||||
|
const hasTriageLabel = issue.labels.some(label => label.name === 'triage');
|
||||||
|
const hasNeedsInfoLabel = issue.labels.some(label => label.name === 'needs-more-info');
|
||||||
|
|
||||||
|
if (isOld && hasTriageLabel && !hasNeedsInfoLabel) {
|
||||||
|
console.log(`Adding reminder to issue #${issue.number}`);
|
||||||
|
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `⏰ **提醒**\n\n这个issue已经开放3天了,但还没有被标记或分类。\n\n**维护者请注意:**\n- 请审查此issue并添加适当的标签\n- 如果需要更多信息,请添加 \`needs-more-info\` 标签\n- 如果是有效的bug或功能请求,请移除 \`triage\` 标签并添加适当的优先级标签\n\n**提交者请注意:**\n- 如果您有更多信息可以补充,请随时添加\n- 确保您已经提供了足够的详细信息来重现问题或理解功能需求`
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: ['stale']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
189
.github/workflows/issue-validation.yml
vendored
Normal file
189
.github/workflows/issue-validation.yml
vendored
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
name: Issue Validation
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened, edited]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate-issue:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check Issue Title Length
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const issue = context.payload.issue;
|
||||||
|
const title = issue.title.trim();
|
||||||
|
const minTitleLength = 10;
|
||||||
|
const maxTitleLength = 120;
|
||||||
|
|
||||||
|
console.log(`Issue title: "${title}"`);
|
||||||
|
console.log(`Title length: ${title.length}`);
|
||||||
|
|
||||||
|
// 去除模板前缀进行长度检查
|
||||||
|
const cleanTitle = title.replace(/^\[(Bug|Feature|General)\]:\s*/i, '').trim();
|
||||||
|
|
||||||
|
if (cleanTitle.length < minTitleLength) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `⚠️ **标题过短**\n\n您的issue标题内容太短了(当前有效内容${cleanTitle.length}个字符,最少需要${minTitleLength}个字符)。请提供一个更具描述性的标题,以便我们更好地理解问题。\n\n**示例:**\n- ✅ "[Bug]: 微信无法启动显示黑屏"\n- ❌ "[Bug]: 有问题"\n\n请编辑issue标题,提供更多详细信息。`
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: ['needs-more-info']
|
||||||
|
});
|
||||||
|
} else if (title.length > maxTitleLength) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `⚠️ **标题过长**\n\n您的issue标题太长了(当前${title.length}个字符,建议不超过${maxTitleLength}个字符)。请简化标题,将详细信息移至描述部分。`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Check Issue Body Length
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const issue = context.payload.issue;
|
||||||
|
const body = issue.body ? issue.body.trim() : '';
|
||||||
|
const minBodyLength = 50;
|
||||||
|
|
||||||
|
console.log(`Issue body length: ${body.length}`);
|
||||||
|
|
||||||
|
if (body.length < minBodyLength) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `⚠️ **描述过短**\n\n您的issue描述太简短了(当前${body.length}个字符,最少需要${minBodyLength}个字符)。为了帮助我们更好地理解和解决问题,请提供以下信息:\n\n- 详细的问题描述\n- 重现步骤\n- 预期行为\n- 实际行为\n- 环境信息(操作系统、浏览器、Docker版本等)\n- 相关日志或错误信息\n\n请编辑issue描述,添加更多详细信息。`
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: ['needs-more-info']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Check for Template Usage
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const issue = context.payload.issue;
|
||||||
|
const body = issue.body || '';
|
||||||
|
|
||||||
|
// 检查是否包含模板中的占位符文本(表明用户没有填写完整)
|
||||||
|
const templatePlaceholders = [
|
||||||
|
'例如:',
|
||||||
|
'placeholder',
|
||||||
|
'...',
|
||||||
|
'请描述',
|
||||||
|
'请填写',
|
||||||
|
'请提供'
|
||||||
|
];
|
||||||
|
|
||||||
|
const hasPlaceholders = templatePlaceholders.some(placeholder =>
|
||||||
|
body.toLowerCase().includes(placeholder)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (hasPlaceholders) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `⚠️ **模板未完整填写**\n\n看起来您可能没有完全填写issue模板。请确保:\n\n- 删除所有占位符文本和示例\n- 填写所有必需的字段\n- 提供真实的、具体的信息\n\n这将帮助我们更快地理解和解决您的问题。`
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: ['needs-more-info']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Auto-assign Labels Based on Content
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const issue = context.payload.issue;
|
||||||
|
const title = issue.title.toLowerCase();
|
||||||
|
const body = (issue.body || '').toLowerCase();
|
||||||
|
const content = title + ' ' + body;
|
||||||
|
|
||||||
|
const labelRules = [
|
||||||
|
{
|
||||||
|
keywords: ['docker', 'dockerfile', 'compose', '容器'],
|
||||||
|
label: 'docker'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keywords: ['微信', 'wechat', '登录', 'login'],
|
||||||
|
label: 'wechat'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keywords: ['网络', 'network', 'proxy', '代理', 'ssl', 'https'],
|
||||||
|
label: 'network'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keywords: ['性能', 'performance', 'slow', '慢', 'memory', '内存'],
|
||||||
|
label: 'performance'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keywords: ['音频', 'audio', '声音', 'sound'],
|
||||||
|
label: 'audio'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keywords: ['视频', 'video', '显示', 'display'],
|
||||||
|
label: 'video'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
keywords: ['文档', 'documentation', 'readme', 'doc'],
|
||||||
|
label: 'documentation'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const labelsToAdd = [];
|
||||||
|
for (const rule of labelRules) {
|
||||||
|
if (rule.keywords.some(keyword => content.includes(keyword))) {
|
||||||
|
labelsToAdd.push(rule.label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labelsToAdd.length > 0) {
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: labelsToAdd
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Welcome First Time Contributors
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const issue = context.payload.issue;
|
||||||
|
|
||||||
|
// 检查是否是首次提交issue的用户
|
||||||
|
const { data: issues } = await github.rest.issues.listForRepo({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
creator: issue.user.login,
|
||||||
|
state: 'all'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (issues.length === 1) {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: `🎉 **欢迎首次贡献!**\n\n感谢您提交第一个issue!我们很高兴您选择使用并改进这个项目。\n\n**接下来会发生什么:**\n- 维护者将审查您的issue\n- 如果需要更多信息,我们会在评论中询问\n- 我们会尽快回复并提供帮助\n\n**有用的资源:**\n- [项目文档](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/master/README.md)\n- [讨论区](https://github.com/${context.repo.owner}/${context.repo.repo}/discussions)\n\n再次感谢您的贡献! 🙏`
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user