From 885e73187225b654048e3541319059da47904390 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 19 Jul 2022 12:00:53 +0530 Subject: [PATCH] ci: lint commit messages (#31625) --- .github/workflows/semantic-commits.yml | 30 ++++++++++++++++++++++++++ package.json | 5 +++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/semantic-commits.yml diff --git a/.github/workflows/semantic-commits.yml b/.github/workflows/semantic-commits.yml new file mode 100644 index 00000000000..1744bc33a9e --- /dev/null +++ b/.github/workflows/semantic-commits.yml @@ -0,0 +1,30 @@ +name: Semantic Commits + +on: + pull_request: {} + +permissions: + contents: read + +concurrency: + group: commitcheck-erpnext-${{ github.event.number }} + cancel-in-progress: true + +jobs: + commitlint: + name: Check Commit Titles + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 200 + + - uses: actions/setup-node@v3 + with: + node-version: 14 + check-latest: true + + - name: Check commit titles + run: | + npm install @commitlint/cli @commitlint/config-conventional + npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} diff --git a/package.json b/package.json index 6c11e9dddc7..8b2c3420b21 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,10 @@ "dependencies": { "html2canvas": "^1.1.4", "onscan.js": "^1.5.2" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] } }