diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..7bfd4f7 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,18 @@ +name: commitlint +on: + pull_request: + types: [opened, reopened, synchronize] + +permissions: + contents: read + pull-requests: read + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + # PR의 모든 커밋 메시지를 conventional commits 규칙으로 검사한다 (commitlint.config.mjs 사용) + - uses: wagoid/commitlint-github-action@v6 diff --git a/.gitignore b/.gitignore index a5b2aed..35c0dd5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ !/defaults.yaml !/docs/ !/policies/ +!/.github/ +!/commitlint.config.mjs diff --git a/commitlint.config.mjs b/commitlint.config.mjs new file mode 100644 index 0000000..2ad615a --- /dev/null +++ b/commitlint.config.mjs @@ -0,0 +1,18 @@ +// Conventional Commits 1.0.0 기반 + 한글 커밋 메시지 규칙 (조직 공통 설정 — pilot과 동일) +export default { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [ + 2, + 'always', + ['feat', 'fix', 'perf', 'refactor', 'style', 'docs', 'test', 'build', 'ci', 'chore', 'revert'] + ], + 'scope-case': [0], + 'subject-case': [0], + 'subject-max-length': [2, 'always', 50], + 'subject-full-stop': [2, 'never', '.'], + 'header-max-length': [2, 'always', 72], + 'body-leading-blank': [2, 'always'], + 'footer-leading-blank': [2, 'always'] + } +}