Skip to content

Commit 2618424

Browse files
docs: remove branch name depth limit
Co-Authored-By: Claude <claude@users.noreply.github.com>
1 parent c207445 commit 2618424

4 files changed

Lines changed: 35 additions & 47 deletions

File tree

.github/docs/branch-name-guide.md

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**실행 시점**: Pull Request 생성/수정 시 (자동)
44
**워크플로우**: `.github/workflows/branch-name-check.yml`
5-
**형식**: `<type>/<description>` 또는 `<type>/<domain>/<description>`
5+
**형식**: `<type>/<description>` 또는 `<type>/<segment>/<segment>/...` (depth 제한 없음)
66

77
## 허용 타입
88

@@ -27,40 +27,33 @@
2727

2828
## 브랜치명 규칙
2929

30-
### ✅ 올바른 형식
31-
3230
- **타입**: 위 표의 허용된 타입 중 하나 사용
3331
- **구분자**: `/` (슬래시) 사용
3432
- **허용 문자**: 소문자(a-z), 숫자(0-9), 하이픈(-), 점(.), 언더바(_)
3533

36-
#### 2단계 형식 (기본)
37-
38-
```bash
39-
✅ feature/user-authentication
40-
✅ fix/404-error
41-
✅ copilot/add-validation
42-
✅ claude/refactor-api
43-
✅ hotfix/security-patch-2024
44-
✅ release/1.0.0
45-
```
46-
47-
#### 3단계 형식 (도메인 포함)
34+
### ✅ 올바른 형식
4835

4936
```bash
50-
✅ feature/frontend/user-authentication
51-
✅ fix/api/null-response
52-
✅ refactor/backend/auth-logic
53-
✅ docs/api/endpoint-guide
54-
✅ test/integration/payment-flow
55-
✅ dependabot/npm_and_yarn/turbo-2.7.3
37+
feature/user-authentication
38+
fix/404-error
39+
copilot/add-validation
40+
claude/refactor-api
41+
hotfix/security-patch-2024
42+
release/1.0.0
43+
feature/frontend/user-authentication
44+
fix/api/null-response
45+
refactor/backend/auth-logic
46+
docs/api/endpoint-guide
47+
test/integration/payment-flow
48+
dependabot/npm_and_yarn/turbo-2.7.3
49+
dependabot/npm_and_yarn/tailwindcss/postcss-4.1.18
5650
```
5751

5852
### ❌ 잘못된 형식
5953

6054
```bash
6155
❌ Feature/Frontend/User-auth # 타입, 도메인, 설명에 대문자 사용 금지
6256
❌ my-feature # 타입 누락
63-
❌ feature/a/b/c # 4단계 이상 금지
6457
❌ feature/ # 설명 누락
6558
```
6659

.github/workflows/branch-name-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
# 허용된 타입
2626
VALID_TYPES="feature|fix|hotfix|release|refactor|docs|test|chore|style|copilot|claude|dependabot"
2727
28-
# 패턴: type/description 또는 type/domain/description
28+
# 패턴: type/description 또는 type/segment1/segment2/... (depth 제한 없음)
2929
# 허용: 소문자(a-z), 숫자(0-9), 하이픈(-), 점(.), 언더바(_)
30-
PATTERN="^(${VALID_TYPES})/[a-z0-9][a-z0-9._-]*(/[a-z0-9][a-z0-9._-]*)?$"
30+
PATTERN="^(${VALID_TYPES})/[a-z0-9][a-z0-9._-]*(/[a-z0-9][a-z0-9._-]*)*$"
3131
3232
if [[ ! "$BRANCH" =~ $PATTERN ]]; then
3333
echo "❌ Invalid branch name: $BRANCH"

.husky/docs/branch-name-guide.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**실행 시점**: `git push` 시 (푸시 전)
44
**스크립트**: `.husky/validate-branch.cjs`
5-
**형식**: `<type>/<description>` 또는 `<type>/<domain>/<description>`
5+
**형식**: `<type>/<description>` 또는 `<type>/<segment>/<segment>/...` (depth 제한 없음)
66
**허용 문자**: 소문자(a-z), 숫자(0-9), 하이픈(-), 점(.), 언더바(_)
77

88
## 허용 타입
@@ -28,34 +28,29 @@
2828

2929
## 브랜치명 형식
3030

31-
### 2단계 형식 (기본)
31+
### ✅ 올바른 형식
3232

3333
```bash
34-
✅ feature/user-authentication
35-
✅ fix/404-error
36-
✅ copilot/add-validation
37-
✅ claude/refactor-api
38-
✅ hotfix/security-patch-2024
39-
✅ release/1.0.0
40-
```
41-
42-
### 3단계 형식 (도메인 포함)
43-
44-
```bash
45-
✅ feature/frontend/user-authentication
46-
✅ fix/api/null-response
47-
✅ refactor/backend/auth-logic
48-
✅ docs/api/endpoint-guide
49-
✅ test/integration/payment-flow
50-
✅ dependabot/npm_and_yarn/turbo-2.7.3
34+
feature/user-authentication
35+
fix/404-error
36+
copilot/add-validation
37+
claude/refactor-api
38+
hotfix/security-patch-2024
39+
release/1.0.0
40+
feature/frontend/user-authentication
41+
fix/api/null-response
42+
refactor/backend/auth-logic
43+
docs/api/endpoint-guide
44+
test/integration/payment-flow
45+
dependabot/npm_and_yarn/turbo-2.7.3
46+
dependabot/npm_and_yarn/tailwindcss/postcss-4.1.18
5147
```
5248

5349
### ❌ 잘못된 형식
5450

5551
```bash
5652
Feature/Frontend/User-auth # 대문자 사용 금지
5753
my-feature # 타입 누락
58-
feature/a/b/c # 4단계 이상 금지
5954
feature/ # 설명 누락
6055
```
6156

.husky/validate-branch.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {execSync} = require('child_process');
44

55
// 허용 규칙
66
const validTypes = ['feature', 'fix', 'hotfix', 'release', 'refactor', 'docs', 'test', 'chore', 'style', 'copilot', 'claude', 'dependabot'];
7-
const validPattern = '<type>/<description> 또는 <type>/<domain>/<description>';
7+
const validPattern = '<type>/<description> 또는 <type>/<segment>/<segment>/...';
88

99
// 현재 브랜치명 확인
1010
let currentBranch;
@@ -21,9 +21,9 @@ if (protectedBranches.includes(currentBranch)) {
2121
process.exit(0);
2222
}
2323

24-
// 패턴: `type/description` 또는 `type/domain/description`
24+
// 패턴: `type/description` 또는 `type/segment1/segment2/...` (depth 제한 없음)
2525
// 허용: 소문자(a-z), 숫자(0-9), 하이픈(-), 점(.), 언더바(_)
26-
const branchPattern = new RegExp(`^(${validTypes.join('|')})\\/[a-z0-9][a-z0-9._-]*(\\/[a-z0-9][a-z0-9._-]*)?$`);
26+
const branchPattern = new RegExp(`^(${validTypes.join('|')})\\/[a-z0-9][a-z0-9._-]*(\\/[a-z0-9][a-z0-9._-]*)*$`);
2727
if (!branchPattern.test(currentBranch)) {
2828
console.error(`* 잘못된 형식 : ${currentBranch}`);
2929
console.error(`* 올바른 형식 : ${validPattern}`);

0 commit comments

Comments
 (0)