Skip to content

What do you think about Visual Studio Marketplace? We are looking for feedback from developers like you! Take the survey

| Marketplace
Sign in
Azure DevOps>Azure Pipelines>Commit Comment Validator

Commit Comment Validator

True Velocity

|
2 installs
| (0) | Free
Validate commit messages in a PR or diff with a target branch. Defaults validate that commit comments match the Conventional Commits specification. https://www.conventionalcommits.org

Purpose

This extension provided a build task called "Commit Comment Validator" which allows teams to validate that either some or all commits in pull requests conform to a supplied regular expression.

How to use

After installing the extension, you can add the task to your pipeline.

Example

- task: CommitMessageValidator@1
  inputs:
    regExPattern: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\.\-\p{Extended_Pictographic}]+\))?(!)?: ([\w \p{Extended_Pictographic}])+([\s\S]*)'
    regExFlags: "um"
    allCommitsMustMatch: true
    prMode: true
- task: CommitMessageValidator@1
  inputs:
    regExPattern: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\.\-\p{Extended_Pictographic}]+\))?(!)?: ([\w \p{Extended_Pictographic}])+([\s\S]*)'
    regExFlags: "um"
    allCommitsMustMatch: true
    prMode: false
    diffBranch: origin/main

Restrictions

This task has only been tested against Azure DevOps repositories. Also there are known issues with regular expression parsing with older versions of Node.

Contribute

At the moment this code is private but we would consider opening it up to the public. Please send an email if you'd be interested in contributing and we may consider opening a public repository.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft