Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Commit Message Lint

on:
pull_request:
types: [opened, synchronize, edited]

jobs:
lint-commits:
runs-on: ubuntu-latest

steps:
- name: Checkout PR branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install dependencies
run: npm ci

- name: Lint commit messages
uses: wagoid/commitlint-github-action@v4
with:
from: ${{ github.base_ref }}
to: ${{ github.head_ref }}
verbose: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ command_output.log
# Properties
src/main/environment/1097_local.properties
src/main/environment/common_local.properties

node_modules/
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install cz
36 changes: 36 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"body-leading-blank": [1, "always"],
"body-max-line-length": [2, "always", 100],
"footer-leading-blank": [1, "always"],
"footer-max-line-length": [2, "always", 100],
"header-max-length": [2, "always", 100],
"subject-case": [
2,
"never",
["sentence-case", "start-case", "pascal-case", "upper-case"],
],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
],
],
},
};
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "identity-api",
"version": "1.0.0",
"description": "Identity API for user authentication and authorization.",
"main": "index.js",
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"scripts": {
"test": "echo \"No tests specified\"",
"prepare": "husky install",
"commit": "cz"
},
"repository": {
"type": "git",
"url": "git+https://github.com/PSMRI/Identity-API.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/PSMRI/Identity-API/issues"
},
"homepage": "https://github.com/PSMRI/Identity-API#readme",
"devDependencies": {
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"commitizen": "^4.3.1",
"cz-conventional-changelog": "^3.3.0",
"husky": "^9.1.7"
}
}