Skip to content

Commit f68fab8

Browse files
committed
init: 프로젝트 초기세팅
1 parent 7b3e5b6 commit f68fab8

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

.github/ISSUE_TEMPLATE/issue-form.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ body:
2020
- fix
2121
- hotfix
2222
- refactor
23+
- test
2324
- docs
2425
- chore
2526
validations:

.github/workflows/autobranch.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,29 @@ jobs:
112112
NEW_TITLE="${{ steps.extract.outputs.new_issue_title }}"
113113
BRANCH_TYPE="${{ steps.extract.outputs.branch_type }}"
114114
115-
if [ -n "$NEW_TITLE" ] && [ -n "$BRANCH_TYPE" ]; then
115+
# 브랜치 타입을 이모지 라벨로 매핑
116+
case "$BRANCH_TYPE" in
117+
"feat") LABEL="✨Feature" ;;
118+
"fix") LABEL="🐛BugFix" ;;
119+
"hotfix") LABEL="🚨Hotfix" ;;
120+
"refactor") LABEL="♻️Refactor" ;;
121+
"test") LABEL="✅Test" ;;
122+
"docs") LABEL="📝Docs" ;;
123+
"chore") LABEL="🛠️ Chore" ;;
124+
*) LABEL="$BRANCH_TYPE" ;;
125+
esac
126+
127+
if [ -n "$NEW_TITLE" ] && [ -n "$LABEL" ]; then
128+
# 이슈 제목, 라벨, 담당자 업데이트
116129
curl -X PATCH \
117130
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
118131
-H "Accept: application/vnd.github.v3+json" \
119132
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
120-
-d "{\"title\":\"$NEW_TITLE\",\"labels\":[\"$BRANCH_TYPE\"]}"
133+
-d "{\"title\":\"$NEW_TITLE\",\"labels\":[\"$LABEL\"],\"assignees\":[\"${{ github.event.issue.user.login }}\"]}"
121134
122135
echo "이슈 제목 업데이트: $NEW_TITLE"
123-
echo "라벨 설정: $BRANCH_TYPE"
136+
echo "라벨 설정: $LABEL"
137+
echo "담당자 할당: ${{ github.event.issue.user.login }}"
124138
fi
125139
126140
- name: Create branch
@@ -138,3 +152,21 @@ jobs:
138152
git push origin "$BRANCH_NAME"
139153
140154
echo "브랜치 '$BRANCH_NAME' 생성 완료"
155+
156+
- name: Add comment to issue
157+
run: |
158+
BRANCH_NAME="${{ steps.extract.outputs.branch_name }}"
159+
160+
COMMENT="🌿 브랜치가 생성되었습니다!
161+
162+
\`\`\`
163+
$BRANCH_NAME
164+
\`\`\`"
165+
166+
curl -X POST \
167+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
168+
-H "Accept: application/vnd.github.v3+json" \
169+
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" \
170+
-d "$(jq -n --arg body "$COMMENT" '{body: $body}')"
171+
172+
echo "이슈에 댓글 추가 완료"

0 commit comments

Comments
 (0)