-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #346 from sharemindteam/feat/issue_number_husky_344
[Feat] husky로 commit 시 이슈 넘버 자동할당하는 로직 추가
- Loading branch information
Showing
3 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
COMMIT_MSG_FILE=$1 | ||
|
||
# 현재 브랜치 이름 가져오기 | ||
branch_name=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
# 브랜치 이름에서 마지막 숫자 추출 | ||
issue_number=$(echo ${branch_name} | grep -o '[0-9]*$') | ||
|
||
# 커밋 메시지 파일의 첫 번째 줄 읽기 | ||
first_line=$(head -n1 ${COMMIT_MSG_FILE}) | ||
|
||
# 브랜치 이름에 숫자가 있는 경우에만 이슈 번호를 커밋 메시지 첫 번째 줄 끝에 추가 | ||
if [ -n "$issue_number" ]; then | ||
sed -i ".bak" "1s/\$/ (#$issue_number)/" ${COMMIT_MSG_FILE} | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters