Eu4ng / template-commitlint

GitHub 저장소에 Commitlint 를 적용하기 위한 템플릿
0 stars 0 forks source link

Merge, Revert 커밋은 Commitlint 적용이 안 될까? #5

Open Eu4ng opened 8 months ago

Eu4ng commented 8 months ago

참고

알아낸 것

  1. Require linear history 옵션을 사용하면 Merge Commit 자체를 막을 수는 있다. image
  2. GitHub Enterprise ServerGitLab 의 pre-receive-hook 을 사용하여 서버 hook 을 이용하는 것이 좋다. image
Eu4ng commented 8 months ago

참고

Running your pull_request workflow when a pull request merges

PR 이 병합된 이후 호출하는 방법

on:
  pull_request:
    types:
      - closed

jobs:
  if_merged:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
    - run: |
        echo The PR was merged
Eu4ng commented 8 months ago

Just enforce it with automation. Prs get rejected if the branch didn't match a format. Pr titles get auto formatted. Only allow Squash merge to master. Only allow "pr title as squash merge commit" Auto write a comment with the ticket so it links to JIRA. Force delete branch on merge.