Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 🐛 Bug Report / 报告问题
description: Report a bug / 报告问题

body:

- type: textarea
id: description
attributes:
label: Description / 问题描述
description: |
Describe what happened.
描述发生的问题。
validations:
required: true


- type: textarea
id: reproduce
attributes:
label: Steps to reproduce / 复现步骤
description: |
Describe how to reproduce the issue.
描述如何复现问题。
placeholder: |
1. Add card...
2. Configure card...
3. See error...


- type: input
id: ha_version
attributes:
label: Home Assistant Version / Home Assistant 版本
description: |
Settings → About
设置 → 关于 Home Assistant
placeholder: "2026.3.0"
validations:
required: true


- type: input
id: card_version
attributes:
label: Card Version / 卡片版本
description: |
Card version from installed resource.
已安装资源中的卡片版本。
placeholder: "1.0.0"
validations:
required: true


- type: textarea
id: additional
attributes:
label: Additional Information / 其他说明
description: |
Provide any additional information, including:
- Card YAML configuration
- Screenshots
- Browser console logs
- Other useful details

请提供其他相关信息,包括:
- 卡片 YAML 配置
- 截图
- 浏览器控制台日志
- 其他有帮助的信息

placeholder: |
Card YAML:

```yaml
type: custom:example-card
entity: sensor.example
```

Screenshots / Logs:
Paste screenshots or logs here.
请在此处粘贴截图或日志。
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ✨ Feature Request / 功能建议
description: Suggest an idea or improvement / 提出功能建议
title: "feat: "
labels:
- "enhancement"

body:

- type: textarea
id: description
attributes:
label: Description / 功能描述
description: |
Describe your idea.
描述你的需求。
validations:
required: true


- type: textarea
id: use_case
attributes:
label: Use case / 使用场景
description: |
Why is this useful?
为什么需要这个功能?


- type: textarea
id: additional
attributes:
label: Additional information / 补充信息
description: |
Add screenshots or examples if available.
如有截图或示例,请提供。
59 changes: 59 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## Description / 变更描述

<!--
Describe what changed and why. / 描述本次修改内容以及原因。
Related Issue / 关联 Issue: #123
-->


## Type of change / 变更类型

- [ ] bugfix: Bug fix / 问题修复
- [ ] new feature: New feature / 新功能
- [ ] refactor: Code refactoring / 重构
- [ ] breaking: Breaking change / 破坏性变更
- [ ] docs: Documentation / 文档更新

## Testing / 测试

<!-- Please provide test environment. / 请填写测试环境。
-->

- HA Version / HA版本:
- Integration Version / 集成版本:
- Test Result / 测试结果:

## Checklist / 自检清单

- [ ] Code follows project standards / 代码符合项目规范
- [ ] No debug code or unrelated files / 无调试代码或无关文件

<!--
PR Rules / PR 规范

Title / 标题:
Format / 格式:
<type>: <description>

Examples / 示例:

feat: add weather forecast support
fix: resolve data update issue
refactor: optimize cache mechanism
breaking: change configuration format
docs: update installation guide

Branch / 分支:
Do not submit PR from main/master
禁止从 main/master 提交 PR

Change Type / 变更类型:
Select one option below
请选择一个类型

CI checks / CI 检查:
✓ Title / 标题
✓ Branch / 分支
✓ Description / 描述
✓ Change Type / 变更类型
-->
63 changes: 63 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ============================
# Default GitHub Labels (with Chinese translation)
# ============================

- name: bug
color: d73a4a
description: Something isn't working / 出现了问题或功能异常

- name: documentation
color: 0075ca
description: Improvements or additions to documentation / 文档改进或补充

- name: duplicate
color: cfd3d7
description: This issue or pull request already exists / 重复的问题或拉取请求

- name: enhancement
color: a2eeef
description: New feature or request / 新功能或改进请求

- name: good first issue
color: 7057ff
description: Good for newcomers / 适合新贡献者的简单问题

- name: help wanted
color: 008672
description: Extra attention is needed / 需要额外帮助或关注

- name: invalid
color: e4e669
description: This doesn't seem right / 无效或不符合要求的问题

- name: question
color: d876e3
description: Further information is requested / 需要进一步信息或澄清

- name: wontfix
color: ffffff
description: This will not be worked on / 不会处理或修复的问题

# ============================
# Custom Labels (Your Labels)
# ============================

- name: 🐛 Bug Fix
color: d73a4a
description: Bug fixes and issue corrections / 修复问题和错误

- name: ✨ Feature
color: a2eeef
description: New features and functionality improvements / 新功能和功能增强

- name: 🔧 Refactor
color: fbca04
description: Code refactoring and internal improvements / 代码重构和内部优化

- name: ⚠️ Breaking
color: b60205
description: Breaking changes that may affect existing behavior / 可能影响现有行为的破坏性变更

- name: 📝 Docs
color: 0075ca
description: Documentation updates and improvements / 文档更新和改进
25 changes: 25 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
changelog:
categories:
- title: "✨ Features / 新功能"
labels:
- "✨ Feature"

- title: "🐛 Bug Fixes / 问题修复"
labels:
- "🐛 Bug Fix"

- title: "🔧 Refactor / 重构"
labels:
- "🔧 Refactor"

- title: "📝 Documentation / 文档"
labels:
- "📝 Docs"

- title: "⚠️ Breaking Changes / 破坏性变更"
labels:
- "⚠️ Breaking"

- title: "Other Changes / 其他"
labels:
- "*"
113 changes: 113 additions & 0 deletions .github/workflows/pr-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Auto Label PR Type

on:
pull_request:
types: [opened, edited, synchronize]

permissions:
contents: read
pull-requests: write
issues: write

jobs:
label:
runs-on: ubuntu-latest

steps:
- name: Detect change type and sync label
env:
PR_BODY: ${{ github.event.pull_request.body }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

shell: bash
run: |

echo "Checking change type"


PR_TYPE=$(echo "$PR_BODY" \
| grep -E '\[x\].*(bugfix|new feature|refactor|breaking|docs):' \
| sed -E 's/.*\] ([^:]+):.*/\1/')


if [[ -z "$PR_TYPE" ]]; then
echo "❌ No change type selected"
exit 1
fi


echo "Detected type: $PR_TYPE"


case "$PR_TYPE" in
bugfix)
LABEL="🐛 Bug Fix"
;;
"new feature")
LABEL="✨ Feature"
;;
refactor)
LABEL="🔧 Refactor"
;;
breaking)
LABEL="⚠️ Breaking"
;;
docs)
LABEL="📝 Docs"
;;
*)
echo "❌ Invalid type: $PR_TYPE"
exit 1
;;
esac


echo "Target label: $LABEL"


CURRENT_LABELS=$(gh pr view "$PR_NUMBER" \
--repo "$REPO" \
--json labels \
-q '.labels[].name')


if echo "$CURRENT_LABELS" | grep -Fxq "$LABEL"; then
echo "✅ Label already exists: $LABEL"
exit 0
fi


echo "Updating labels"


OLD_LABELS=(
"🐛 Bug Fix"
"✨ Feature"
"🔧 Refactor"
"⚠️ Breaking"
"📝 Docs"
)


for OLD_LABEL in "${OLD_LABELS[@]}"; do
if echo "$CURRENT_LABELS" | grep -Fxq "$OLD_LABEL"; then
echo "Removing old label: $OLD_LABEL"

gh pr edit "$PR_NUMBER" \
--repo "$REPO" \
--remove-label "$OLD_LABEL"
fi
done


echo "Adding label: $LABEL"


gh pr edit "$PR_NUMBER" \
--repo "$REPO" \
--add-label "$LABEL"


echo "✅ Label updated: $LABEL"
Loading
Loading