From 7ed9eda41da90115cde018ff8a2ba7226ccde83a Mon Sep 17 00:00:00 2001 From: "Baruch Odem (Rothkoff)" Date: Tue, 6 Jun 2023 17:34:02 +0300 Subject: [PATCH] ci: validate PR title with conventional commits (#101) --- .github/workflows/pr-title.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..c3143ef --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,18 @@ +name: Validate Conventional Commit title + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: install commitlint + run: npm install -g @commitlint/cli @commitlint/config-conventional + - name: config commitlint + run: | + echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js + - name: validate PR title + run: | + echo ${{ github.event.pull_request.title }} | commitlint