MCPcopy Index your code
hub / github.com/anomalyco/opencode / generateBranchName

Function generateBranchName

packages/opencode/src/cli/cmd/github.handler.ts:1070–1082  ·  view source on GitHub ↗
(type: "issue" | "pr" | "schedule" | "dispatch")

Source from the content-addressed store, hash-verified

1068 }
1069
1070 function generateBranchName(type: "issue" | "pr" | "schedule" | "dispatch") {
1071 const timestamp = new Date()
1072 .toISOString()
1073 .replace(/[:-]/g, "")
1074 .replace(/\.\d{3}Z/, "")
1075 .split("T")
1076 .join("")
1077 if (type === "schedule" || type === "dispatch") {
1078 const hex = crypto.randomUUID().slice(0, 6)
1079 return `opencode/${type}-${hex}-${timestamp}`
1080 }
1081 return `opencode/${type}${issueId}-${timestamp}`
1082 }
1083
1084 async function pushToNewBranch(summary: string, branch: string, commit: boolean, isSchedule: boolean) {
1085 console.log("Pushing to new branch...")

Callers 2

checkoutNewBranchFunction · 0.70
checkoutForkBranchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected