Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/pull-request-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Pull Request 작성 가이드

제목 형식 : `<type>(<scope>): <description>`

## 규칙

- **소문자**로 시작
- **명령형 현재 시제** 사용 (add, 과거형 added가 아님)
Comment thread
kimchanhyung98 marked this conversation as resolved.
- 마침표 **없음**
- **50자 이내** 권장
Comment thread
kimchanhyung98 marked this conversation as resolved.

## 🏷️ Types

| Type | 설명 | 예시 |
|------------|-----------|-----------------------------------------------|
| `feat` | 새로운 기능 추가 | `feat(user): add email verification` |
| `fix` | 버그 수정 | `fix(payment): resolve timeout error` |
| `docs` | 문서 변경 | `docs(api): add OpenAPI spec` |
| `style` | 코드 스타일 변경 | `style(user): format with prettier` |
| `refactor` | 코드 리팩토링 | `refactor(order): extract calculation logic` |
| `test` | 테스트 추가/수정 | `test(user): add authentication tests` |
| `chore` | 기타 변경사항 | `chore(deps): upgrade Laravel to 12.1` |
| `perf` | 성능 개선 | `perf(database): optimize user query` |
| `ci` | CI/CD 변경 | `ci(github): add deployment workflow` |
| `build` | 빌드 시스템 변경 | `build(docker): update PHP to 8.5` |
| `revert` | 이전 커밋 되돌리기 | `revert(payment): revert payment feature` |

## 🎯 Scopes

| Scope | 설명 |
|-----------------------------------------|---------|
| `user`, `product`, `order`, `payment` | 도메인 관련 |
| `auth`, `api`, `database`, `middleware` | 컴포넌트 관련 |
| `service`, `controller`, `model` | 레이어 관련 |
| `docker`, `deps`, `config`, `github` | 인프라 관련 |

## 예시

```
feat(user): add email verification
fix(payment): resolve timeout error
refactor(order): extract calculation logic
docs(api): add OpenAPI specification
chore(deps): upgrade Laravel to 12.1
```
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
## PR Title Format
Please ensure your PR title follows the Conventional Commits format:
<type>(<scope>): <description>

Types: feat, fix, docs, refactor, test, chore, perf, ci, build, style, revert
Scopes: user, product, order, payment, auth, api, database, middleware, service, controller, model, docker, deps, config, github
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated

Examples:
- feat(user): add social login support
- fix(payment): resolve duplicate transaction issue
- refactor(user): extract service layer from controllers
-->
59 changes: 59 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Lint PR"

on:
pull_request_target:
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
Comment thread
kimchanhyung98 marked this conversation as resolved.

permissions:
pull-requests: write
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
statuses: write

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
Comment thread
kimchanhyung98 marked this conversation as resolved.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (Conventional Commits spec)
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert

# Scope is required for all PRs
requireScope: true

# Disallow uppercase scopes and multiple scopes
Comment thread
kimchanhyung98 marked this conversation as resolved.
disallowScopes: |
[A-Z]+

# Work in progress PR support
wip: true

# Skip validation for PRs with these labels
ignoreLabels: |
bot
ignore-semantic-pull-request

# Ensure the subject doesn't start with an uppercase character
subjectPattern: ^[a-z].*$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
starts with a lowercase character.