GitHub Issue가 생성되거나 제목이 수정될 때 자동으로 브랜치명과 커밋 메시지를 생성하여 댓글로 추가하는 GitHub Action입니다.
.github/workflows/issue-helper.yml 파일을 생성합니다:
name: Issue Helper - Generate Branch & Commit Messages
on:
issues:
types: [opened, edited]
permissions:
issues: write
contents: read
jobs:
generate-comment:
if: github.event.action == 'opened' || (github.event.action == 'edited' && github.event.changes.title)
runs-on: ubuntu-latest
steps:
- name: Generate Branch & Commit Comment
uses: Chuseok22/github-issue-helper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch_prefix: "feat/"
max_branch_length: 100
commit_template: "${issueTitle} : feat : {변경 사항에 대한 설명} ${issueUrl}"
comment_marker: "<!-- Chuseok22 issue helper -->""Resource not accessible by integration" 오류가 발생하는 경우:
permissions:
issues: write
contents: read- Settings > Actions > General
- "Workflow permissions"에서 "Read and write permissions" 선택
Personal Access Token을 사용하세요:
- GitHub에서 Personal Access Token 생성 (repo 권한 필요)
- Repository Settings > Secrets and variables > Actions에 토큰 추가 (예:
PERSONAL_TOKEN) - 워크플로우에서 토큰 사용:
- name: Generate Branch & Commit Comment
uses: Chuseok22/github-issue-helper@v1
with:
token: ${{ secrets.PERSONAL_TOKEN }}
# ...other inputs- 🌿 브랜치명 자동 생성: 날짜, 이슈번호, 정규화된 제목으로 브랜치명 생성
- 💬 커밋 메시지 템플릿: 커스터마이징 가능한 커밋 메시지 템플릿
- 🔄 댓글 업데이트: 이슈 제목 변경 시 자동으로 댓글 업데이트
- 🔒 Private Repository 지원: 사용자 토큰으로 Private Repository에서도 사용 가능
- 🎯 한글/영문 지원: 한글과 영문 이슈 제목 모두 지원
| 입력값 | 설명 | 기본값 | 필수 |
|---|---|---|---|
token |
GitHub 토큰 (빈 값이면 GITHUB_TOKEN 자동 사용) | "" |
❌ |
comment_marker |
댓글 업데이트를 위한 마커 | "<!-- Chuseok22 issue helper -->" |
❌ |
branch_prefix |
브랜치 접두사 (예: feat/) | "" |
❌ |
max_branch_length |
브랜치 기본 부분 최대 길이 (prefix 제외) | "120" |
❌ |
commit_template |
커밋 메시지 템플릿 | "${issueTitle} : feat : {변경 사항에 대한 설명} ${issueUrl}" |
❌ |
| 출력값 | 설명 |
|---|---|
branchName |
생성된 브랜치명 |
commitMessage |
생성된 커밋 메시지 |
커밋 메시지 템플릿에서 사용할 수 있는 변수들:
${issueTitle}: 정규화된 이슈 제목${issueUrl}: 이슈 URL${issueNumber}: 이슈 번호${branchName}: 생성된 브랜치명${date}: 날짜 (YYYYMMDD 형식)
생성되는 결과:
- 브랜치명:
feat/20250917_#123_로그인_페이지에서_비밀번호_입력_오류 - 커밋 메시지:
로그인 페이지에서 비밀번호 입력 오류 : feat : {변경 사항에 대한 설명} https://github.com/owner/repo/issues/123
<!-- Chuseok22 issue helper -->
## Chuseok22 Issue Helper
### 브랜치명
```
feat/20250917_#123_로그인_페이지에서_비밀번호_입력_오류
```
### 커밋 메시지
```
로그인 페이지에서 비밀번호 입력 오류 : feat : {변경 사항에 대한 설명} https://github.com/owner/repo/issues/123
```
- 태그 제거:
[Bug],[Feature]등의 태그 제거 - 이모지 제거: 이모지와 제어 문자 제거
- 특수문자 처리: 한글, 영문, 숫자를 제외한 문자는
_로 변경 - 브랜치명 형식:
{prefix}{YYYYMMDD}_#{issueNumber}_{normalizedTitle}
MIT License
이슈나 개선사항이 있으시면 언제든지 Issue를 등록하거나 Pull Request를 보내주세요!