diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5f0889c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/pull-request-guide.md b/.github/pull-request-guide.md new file mode 100644 index 0000000..647e687 --- /dev/null +++ b/.github/pull-request-guide.md @@ -0,0 +1,45 @@ +# Pull Request 작성 가이드 + +제목 형식 : `(): ` + +## 규칙 + +- **소문자**로 시작 +- **명령형 현재 시제** 사용 (add, 과거형 added가 아님) +- 마침표 **없음** +- **50자 이내** 권장 + +## 🏷️ 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 +``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..273fe8c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ + diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml new file mode 100644 index 0000000..9568f6c --- /dev/null +++ b/.github/workflows/pr-title-check.yml @@ -0,0 +1,59 @@ +name: "Lint PR" + +on: + pull_request: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +permissions: + pull-requests: read + statuses: write + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v6 + 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 + 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.