Skip to content

Commit b0a743b

Browse files
committed
fix(collection): detect two part branches
1 parent cc72e1d commit b0a743b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/utils/git.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,14 @@ export function parseGitHubUrl(url: string) {
7070
if (match) {
7171
const org = match[1]
7272
const repo = match[2]
73-
const branch = match[3] || 'main' // Default to 'main' if no branch is provided
74-
const path = match[4] || ''
73+
let branch = match[3] || 'main' // Default to 'main' if no branch is provided
74+
let path = match[4] || ''
75+
76+
if (['fix', 'feat', 'chore', 'test', 'docs'].includes(branch)) {
77+
const pathParts = path.split('/')
78+
branch = join(branch, pathParts[0])
79+
path = pathParts.slice(1).join('/')
80+
}
7581

7682
return {
7783
org: org,

0 commit comments

Comments
 (0)