From 5f3f4263b4740dba726f155c21c7606235847b28 Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Mon, 19 Jul 2021 00:26:17 +0200 Subject: ci: add commit linter to GitHub Actions --- .github/workflows/commitlint.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/commitlint.yml (limited to '.github/workflows/commitlint.yml') diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000000..9ae138fbd7 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,18 @@ +name: "Commit Linter" +on: pull_request +jobs: + lint-commits: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2.3.1 + with: + fetch-depth: 0 + - run: npm install --save-dev @commitlint/cli + - run: | + if [[ "$(gh pr view ${{ github.event.pull_request.number }} --json commits --jq '.[][0].messageHeadline')" == vim-patch* ]];then + npx commitlint --from HEAD~1 --to HEAD --verbose --help-url https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages --config .github/workflows/commitlint.config_patch.js + else + npx commitlint --from HEAD~1 --to HEAD --verbose --help-url https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages --config .github/workflows/commitlint.config.js + fi -- cgit