From aeac11dfd485e4e628f8e8b79acc947b0bff8fc5 Mon Sep 17 00:00:00 2001 From: qaifshaikh Date: Sat, 21 Feb 2026 08:47:51 +0530 Subject: [PATCH] feat(DEVPRD-3179): add automated semantic versioning and commit linting Implement semantic-release for automated version management and changelog generation, plus commitlint for commit message validation based on conventional commits. --- .github/workflows/commitlint.yaml | 11 ++++++ .github/workflows/semantic-release.yaml | 15 +++++++ commitlint.config.js | 52 +++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .github/workflows/commitlint.yaml create mode 100644 .github/workflows/semantic-release.yaml create mode 100644 commitlint.config.js diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml new file mode 100644 index 000000000..215f59e5c --- /dev/null +++ b/.github/workflows/commitlint.yaml @@ -0,0 +1,11 @@ +name: Commit Lint + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + commitlint: + uses: KeepTruckin/github-workflows-catalog/.github/workflows/commitlint.yaml@master + with: + node_version: "20" diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml new file mode 100644 index 000000000..0d43169d0 --- /dev/null +++ b/.github/workflows/semantic-release.yaml @@ -0,0 +1,15 @@ +name: Semantic Release + +on: + push: + branches: + - master + - main + - develop + - development + +jobs: + release: + uses: KeepTruckin/github-workflows-catalog/.github/workflows/semantic-release.yaml@master + secrets: + KTBOT_GH_PAT: ${{ secrets.KTBOT_GH_PAT }} diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..f362c48be --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,52 @@ +module.exports = { + extends: ["@commitlint/config-conventional"], + rules: { + // Type must be one of these + "type-enum": [ + 2, + "always", + [ + "feat", // New feature + "fix", // Bug fix + "docs", // Documentation only changes + "style", // Changes that don't affect code meaning (formatting, etc) + "refactor", // Code change that neither fixes a bug nor adds a feature + "perf", // Performance improvement + "test", // Adding or updating tests + "chore", // Changes to build process or auxiliary tools + "revert", // Revert a previous commit + "build", // Changes to build system or dependencies + "ci", // Changes to CI configuration + ], + ], + + // Scope is REQUIRED and should be the JIRA ticket (e.g., DEVPRD-3177) + "scope-empty": [2, "never"], + "scope-case": [2, "always", "upper-case"], + + // Subject must not be sentence-case, start-case, pascal-case, upper-case + "subject-case": [ + 2, + "never", + ["sentence-case", "start-case", "pascal-case", "upper-case"], + ], + + // Subject must not end with a period + "subject-full-stop": [2, "never", "."], + + // Subject must not be empty + "subject-empty": [2, "never"], + + // Type must not be empty + "type-empty": [2, "never"], + + // Header max length (100 characters) + "header-max-length": [2, "always", 100], + + // Body max line length (100 characters) + "body-max-line-length": [2, "always", 100], + + // Footer max line length (100 characters) + "footer-max-line-length": [2, "always", 100], + }, +};