This is a Github Action that ensures that your PR title matches the Commitlint Spec according to the configuration file.
This is helpful when using the "Squash and merge" strategy, Github will suggest to use the PR title as the commit message. With this action you can validate that the PR title will lead to a correct commit message.
Examples for valid PR titles:
- fix(some-scope): correct typo.
- feat(scope): add support for Node 12.
- feat: empty scope
This actions uses the @commitlint/config-conventional that is a shared commitlint config enforcing conventional commits.
Refer to https://www.conventionalcommits.org/en/v1.0.0/ for more information.
name: "Lint PR Title"
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
branches:
- master
- dev
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: ArcBlock/action-lint-pull-request-title@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}