Skip to content

Commit

Permalink
ci: Implement conventional commit validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdichtioui committed Nov 28, 2024
1 parent 39fd7ab commit 23b0e71
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/steps-build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ parameters:
type: string

steps:
- template: templates/validate-commits.yaml

#-if false
- download: current
condition: eq('GeneratedApp', '${{ parameters.projectName }}')
Expand Down
2 changes: 2 additions & 0 deletions build/steps-build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ parameters:
type: string

steps:
- template: templates/validate-commits.yaml

#-if false
- download: current
condition: eq('GeneratedApp', '${{ parameters.projectName }}')
Expand Down
1 change: 1 addition & 0 deletions build/steps-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
default: '$(ProjectName)'

steps:
- template: templates/validate-commits.yaml
- template: templates/gitversion.yml
- template: templates/build-number.yml
- template: templates/flutter-install.yml
Expand Down
10 changes: 10 additions & 0 deletions build/templates/validate-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This template follow the Conventional Commits specification (https://www.conventionalcommits.org/en/v1.0.0/).
steps:
- task: CommitMessageValidator@0
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
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
displayName: 'Validate Commit Messages'

0 comments on commit 23b0e71

Please sign in to comment.