diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index bf00d74..3839abd 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -14,6 +14,11 @@ jobs: steps: - name: Checkout project uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Lint the Commit Messages + uses: wagoid/commitlint-github-action@v1 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..4fedde6 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] } diff --git a/package.json b/package.json index a855617..7e44f0b 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "cross-spawn": "^7.0.0" }, "devDependencies": { + "@commitlint/cli": "^8.0.0", + "@commitlint/config-conventional": "^8.0.0", "@types/chai": "^4.0.0", "@types/cross-spawn": "^6.0.0", "@types/mocha": "^7.0.0", @@ -58,6 +60,7 @@ "@types/sinon": "^7.0.0", "chai": "^4.0.0", "coveralls": "^3.0.0", + "husky": "^4.0.0", "mocha": "^7.0.0", "nyc": "^15.0.0", "sinon": "^8.0.0", @@ -91,6 +94,20 @@ "greenkeeper": { "ignore": [ "@types/node" - ] + ], + "commitMessages": { + "initialBadge": "docs: add greenkeeper badge", + "initialDependencies": "chore: update dependencies", + "initialBranches": "chore: whitelist greenkeeper branches", + "dependencyUpdate": "chore: update dependency ${dependency}", + "devDependencyUpdate": "chore: update devDependecy ${dependency}", + "dependencyPin": "fix: pin dependency ${dependency}", + "devDependencyPin": "fix: pin devDependecy ${dependency}" + } + }, + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } } }