diff --git a/.github/workflows/pull-request-name-linter.yml b/.github/workflows/pull-request-name-linter.yml new file mode 100644 index 0000000000..3602d18de8 --- /dev/null +++ b/.github/workflows/pull-request-name-linter.yml @@ -0,0 +1,18 @@ +name: Pull request name linter +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +jobs: + lint-pull-request-title: + name: Lint pull request title + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + - run: yarn global add @commitlint/cli @commitlint/config-conventional + name: Install commitlint + - run: echo "${{github.event.pull_request.title}}" | commitlint --config commitlint.config.ci.js diff --git a/commitlint.config.ci.js b/commitlint.config.ci.js new file mode 100644 index 0000000000..0ea225bb4e --- /dev/null +++ b/commitlint.config.ci.js @@ -0,0 +1,9 @@ +const commitLintConfig = require('./commitlint.config'); + +module.exports = { + ...commitLintConfig, + rules: { + ...commitLintConfig.rules, + 'scope-empty': [2, 'never'], + }, +};