File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : local
3+ hooks :
4+ - id : build-check
5+ name : 빌드 검증
6+ entry : ./build-check.sh
7+ language : script
8+ pass_filenames : false
9+
10+ - id : commit-msg-check
11+ name : 커밋 메시지 포맷 검증
12+ entry : ./check-commit-message.sh
13+ language : script
14+ stages : [ commit-msg ]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cd " $( git rev-parse --show-toplevel) " || exit 1
4+
5+ echo " Gradle 빌드 검증 시작..."
6+
7+ ./gradlew clean build --no-daemon
8+ BUILD_RESULT=$?
9+
10+ if [ $BUILD_RESULT -ne 0 ]; then
11+ echo " ❌ 빌드 실패! 커밋이 중단됩니다."
12+ exit 1
13+ else
14+ echo " ✅ 빌드 성공! 커밋 계속 진행합니다."
15+ exit 0
16+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ commit_msg=$( cat " $1 " )
4+
5+ regex=" ^(feat|fix|chore|docs|style|refactor|test|perf|ci|build|revert) \([[:space:]]*#[[:space:]]*[0-9]+[[:space:]]*\) : .+$"
6+
7+ if [[ " $commit_msg " =~ $regex ]]; then
8+ echo " ✅ 커밋 메시지 형식이 올바릅니다."
9+ exit 0
10+ else
11+ echo " ❌ 커밋 메시지 형식이 잘못되었습니다."
12+ exit 1
13+ fi
You can’t perform that action at this time.
0 commit comments