feat(config): add branch prefix configuration (#197)

This commit is contained in:
Stefano Amorelli
2025-06-26 00:01:25 +03:00
committed by GitHub
parent b0d9b8c4cd
commit 032008d3b6
7 changed files with 17 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ export type ParsedGitHubContext = {
customInstructions: string;
directPrompt: string;
baseBranch?: string;
branchPrefix: string;
};
};
@@ -60,6 +61,7 @@ export function parseGitHubContext(): ParsedGitHubContext {
customInstructions: process.env.CUSTOM_INSTRUCTIONS ?? "",
directPrompt: process.env.DIRECT_PROMPT ?? "",
baseBranch: process.env.BASE_BRANCH,
branchPrefix: process.env.BRANCH_PREFIX ?? "claude/",
},
};

View File

@@ -26,7 +26,7 @@ export async function setupBranch(
): Promise<BranchInfo> {
const { owner, repo } = context.repository;
const entityNumber = context.entityNumber;
const { baseBranch } = context.inputs;
const { baseBranch, branchPrefix } = context.inputs;
const isPR = context.isPR;
if (isPR) {
@@ -97,7 +97,7 @@ export async function setupBranch(
.split("T")
.join("_");
const newBranch = `claude/${entityType}-${entityNumber}-${timestamp}`;
const newBranch = `${branchPrefix}${entityType}-${entityNumber}-${timestamp}`;
try {
// Get the SHA of the source branch