From 09cafda7a74369aa8909ce872e7a79378c469963 Mon Sep 17 00:00:00 2001 From: aquint-zama Date: Fri, 2 Feb 2024 10:20:53 +0100 Subject: [PATCH] ci: add commitlint --- .github/config/commitlint.config.js | 1 + .github/workflows/commitlint.yml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/config/commitlint.config.js create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/config/commitlint.config.js b/.github/config/commitlint.config.js new file mode 100644 index 0000000..5073c20 --- /dev/null +++ b/.github/config/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ["@commitlint/config-conventional"] }; diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..606568e --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,21 @@ +name: Run commitlint on PR + +on: + pull_request: + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: 18.x + - name: Install commitlint + run: | + npm install @commitlint/{cli,config-conventional} + - name: Validate all commits from PR + run: npx commitlint --config .github/config/commitlint.config.js --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose