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
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories:
- title: 'Maintenance'
label: 'maintenance'
- title: 'Documentation'
label: 'docs'
label: 'documentation'
- title: 'Other changes'
- title: 'Dependency Updates'
label: 'dependencies'
Expand All @@ -34,7 +34,7 @@ version-resolver:
labels:
- 'bug'
- 'maintenance'
- 'docs'
- 'documentation'
- 'dependencies'
- 'security'

Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/pr-auto-label.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Auto Label by Title'
name: "Auto Label by Title"

on:
pull_request:
Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
# 添加权限配置
permissions:
issues: write # 或者 contents: write
issues: write # 或者 contents: write
pull-requests: write
steps:
- name: Label PR based on title keywords
Expand All @@ -37,13 +37,20 @@ jobs:
'dependabot': 'dependencies',
'upgrade': 'dependencies',
'security': 'security',
'ci':'ci'
'ci': 'ci'
};

// 检查标题是否包含关键词
for (const [keyword, label] of Object.entries(keywordMap)) {
if (title.includes(keyword)) {
labelsToAdd.add(label);
// 提取标题的第一个单词(冒号前的部分)
const firstPart = title.split(':')[0].trim();
const words = firstPart.split(/\s+/); // 分割成单词数组

// 检查第一个单词或前缀是否匹配关键词
for (const word of words) {
const normalizedWord = word.toLowerCase().replace(/^[\W_]+|[\W_]+$/g, '');

if (keywordMap.hasOwnProperty(normalizedWord)) {
labelsToAdd.add(keywordMap[normalizedWord]);
break; // 找到第一个匹配就停止
}
}

Expand Down
6 changes: 4 additions & 2 deletions docs/source/development/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ git log --stat # 查看所有提交记录的修改文件信息
git log -p file # 查看某个文件的修改历史
git log COMMIT1..COMMIT2 -- file # 查看某个文件从 COMMIT1 到COMMIT2 所有的修改情况(概略信息)
git log COMMIT1..COMMIT2 -p file # 查看某个文件从 COMMIT1 到COMMIT2 所有的修改情况(详细信息)
git log -n 4 --pretty=format:"%s" # 查看最近4条提交记录并只显示提交信息
```

- 合并分支(变基)
Expand Down Expand Up @@ -555,10 +556,11 @@ oco config set OCO_AI_PROVIDER='azure' OCO_MODEL='gpt-4o'
oco config set OCO_API_KEY=xxx
```

3. 【可选】关闭自动 push
3. 【可选配置】

```bash
oco config set OCO_GITPUSH=false
oco config set OCO_GITPUSH=false # 关闭自动 push
oco config set OCO_ONE_LINE_COMMIT=true # 单行 commit
```

4. 使用 oco 命令生成 commit
Expand Down
Loading