commitlint.yml 989 B

1234567891011121314151617181920212223242526
  1. name: "Commit Linter"
  2. on:
  3. pull_request: # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened.
  4. types:
  5. - opened
  6. - edited
  7. - synchronize
  8. - reopened
  9. jobs:
  10. lint-pr-title:
  11. runs-on: ubuntu-latest
  12. env:
  13. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  14. HELP_URL: "https://github.com/LunarVim/LunarVim/blob/rolling/CONTRIBUTING.md#commit-messages"
  15. COMMITLINT_CONFIG: ${{ format('{0}/.github/workflows/commitlint.config.js', github.workspace) }}
  16. GH_REPO: ${{ github.repository }}
  17. PR_NUMBER: ${{ github.event.pull_request.number }}
  18. PR_TITLE: ${{ github.event.pull_request.title }}
  19. steps:
  20. - uses: actions/checkout@v3
  21. - name: install commitlint
  22. run: |
  23. npm install --save-dev @commitlint/cli
  24. - name: run commitlint
  25. run: |
  26. echo "$PR_TITLE" | npx commitlint --verbose --help-url "$HELP_URL" --config "$COMMITLINT_CONFIG"