diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6da96abc9..4c2194572e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,34 @@ on: - main jobs: + check-commit-message: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Check Commit Format + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^(EPMDEDP-\d+: (fix|feat|docs|style|refactor|test|chore)(!)?: .+|(chore|build)\(deps\): Bump .+)$' + error: 'Your commit message should be in the format "EPMDEDP-ID: type: Description". Example: "EPMDEDP-16058: feat: add feature"' + excludeDescription: 'true' + excludeTitle: 'true' + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Check Line Length + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^.{10,72}$' + error: 'The maximum line length of 72 characters is exceeded.' + excludeDescription: 'true' + excludeTitle: 'false' + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }} + test: name: Test runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1ac29da9c..a129dd229c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,11 +93,31 @@ While the prerequisites above must be satisfied prior to having your pull reques ### Git Commit Messages +Commit messages **must** follow the platform format for Jira traceability and changelog generation: + +**Format:** `EPMDEDP-: : ` + +**Example:** `EPMDEDP-16058: feat: add feature` + +**Allowed types:** + +| Type | Purpose | +|----------|----------------------------| +| feat | New feature | +| fix | Bug fix | +| docs | Documentation changes | +| style | Code style/formatting | +| refactor | Code refactoring | +| test | Adding/updating tests | +| chore | Maintenance tasks | + +Use the `!` suffix after the type for breaking changes (e.g. `feat!: change API`). + +**Additional guidelines:** + +Automated dependency update commits are also allowed in the format `chore(deps): Bump ...`. + * Use the present tense ("Add feature" not "Added feature") * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") * Limit the first line to 72 characters or less * Reference issues and pull requests liberally after the first line -* Follow the conventional commits format. For example: - * `feat: Add new feature` - * `fix: Fix issue with login` - * `docs: Update README with usage instructions`