Skip to content

Commit 0329d4e

Browse files
authored
Merge pull request #169 from Comfy-Org/sno-bot
fix: extend prbot branch types to all conventional commit standards
2 parents d043e3d + c7889f1 commit 0329d4e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

bot/code/prbot.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { spawnSubAgent } from "./pr-agent";
44
import zChatCompletion from "z-chat-completion";
55
import z from "zod";
66

7-
const PRBOT_PREFIX_RE = /^prbot-(feat|fix|refactor|docs|test|chore)-(.+)$/;
8-
const TYPE_PREFIX_RE = /^(feat|fix|refactor|docs|test|chore)[/\-](.+)$/;
7+
const CC_TYPES = "feat|fix|build|chore|ci|docs|style|refactor|perf|test|revert";
8+
const PRBOT_PREFIX_RE = new RegExp(`^prbot-(${CC_TYPES})-(.+)$`);
9+
const TYPE_PREFIX_RE = new RegExp(`^(${CC_TYPES})[/\\-](.+)$`);
910

1011
/** Normalize any branch name to prbot-[type]-[name] convention. */
1112
function normalizeProbotBranch(name: string): string {
@@ -72,11 +73,11 @@ async function main() {
7273
head: z
7374
.string()
7475
.regex(
75-
/^prbot-(feat|fix|refactor|docs|test|chore)-[a-z0-9][a-z0-9-]*$/,
76+
/^prbot-(feat|fix|build|chore|ci|docs|style|refactor|perf|test|revert)-[a-z0-9][a-z0-9-]*$/,
7677
"Must follow format: prbot-<type>-<description> (e.g. prbot-feat-add-dark-mode)",
7778
)
7879
.describe(
79-
"Branch name strictly following format: prbot-<type>-<description> where type is one of: feat, fix, refactor, docs, test, chore",
80+
"Branch name strictly following format: prbot-<type>-<description> where type is any conventional commit type: feat, fix, build, chore, ci, docs, style, refactor, perf, test, revert",
8081
),
8182
}),
8283
{
@@ -87,7 +88,7 @@ Given a task description and base branch, generate an appropriate head branch na
8788
8889
REQUIRED FORMAT: prbot-<type>-<description>
8990
- Prefix: always "prbot-"
90-
- Types (pick one): feat, fix, refactor, docs, test, chore
91+
- Types (pick one): feat, fix, build, chore, ci, docs, style, refactor, perf, test, revert
9192
- Description: kebab-case, short and descriptive, lowercase, no slashes
9293
- Examples: "prbot-feat-add-dark-mode", "prbot-fix-login-timeout", "prbot-refactor-simplify-api", "prbot-docs-update-readme"
9394

0 commit comments

Comments
 (0)