File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ categories:
1717 - title : ' Maintenance'
1818 label : ' maintenance'
1919 - title : ' Documentation'
20- label : ' docs '
20+ label : ' documentation '
2121 - title : ' Other changes'
2222 - title : ' Dependency Updates'
2323 label : ' dependencies'
@@ -34,7 +34,7 @@ version-resolver:
3434 labels :
3535 - ' bug'
3636 - ' maintenance'
37- - ' docs '
37+ - ' documentation '
3838 - ' dependencies'
3939 - ' security'
4040
Original file line number Diff line number Diff line change 1- name : ' Auto Label by Title'
1+ name : " Auto Label by Title"
22
33on :
44 pull_request :
1212 runs-on : ubuntu-latest
1313 # 添加权限配置
1414 permissions :
15- issues : write # 或者 contents: write
15+ issues : write # 或者 contents: write
1616 pull-requests : write
1717 steps :
1818 - name : Label PR based on title keywords
@@ -37,13 +37,20 @@ jobs:
3737 'dependabot': 'dependencies',
3838 'upgrade': 'dependencies',
3939 'security': 'security',
40- 'ci':'ci'
40+ 'ci': 'ci'
4141 };
4242
43- // 检查标题是否包含关键词
44- for (const [keyword, label] of Object.entries(keywordMap)) {
45- if (title.includes(keyword)) {
46- labelsToAdd.add(label);
43+ // 提取标题的第一个单词(冒号前的部分)
44+ const firstPart = title.split(':')[0].trim();
45+ const words = firstPart.split(/\s+/); // 分割成单词数组
46+
47+ // 检查第一个单词或前缀是否匹配关键词
48+ for (const word of words) {
49+ const normalizedWord = word.toLowerCase().replace(/^[\W_]+|[\W_]+$/g, '');
50+
51+ if (keywordMap.hasOwnProperty(normalizedWord)) {
52+ labelsToAdd.add(keywordMap[normalizedWord]);
53+ break; // 找到第一个匹配就停止
4754 }
4855 }
4956
Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ git log --stat # 查看所有提交记录的修改文件信息
227227git log -p file # 查看某个文件的修改历史
228228git log COMMIT1..COMMIT2 -- file # 查看某个文件从 COMMIT1 到COMMIT2 所有的修改情况(概略信息)
229229git log COMMIT1..COMMIT2 -p file # 查看某个文件从 COMMIT1 到COMMIT2 所有的修改情况(详细信息)
230+ git log -n 4 --pretty=format:" %s" # 查看最近4条提交记录并只显示提交信息
230231```
231232
232233- 合并分支(变基)
@@ -555,10 +556,11 @@ oco config set OCO_AI_PROVIDER='azure' OCO_MODEL='gpt-4o'
555556oco config set OCO_API_KEY=xxx
556557```
557558
558- 3 . 【可选】关闭自动 push
559+ 3 . 【可选配置】
559560
560561``` bash
561- oco config set OCO_GITPUSH=false
562+ oco config set OCO_GITPUSH=false # 关闭自动 push
563+ oco config set OCO_ONE_LINE_COMMIT=true # 单行 commit
562564```
563565
5645664 . 使用 oco 命令生成 commit
You can’t perform that action at this time.
0 commit comments