I am very new to Azure DevOps and need help with Azure DevOps pipelines. I am setting up a repository with terraform files.
- I want to enforce semantic versioning in the repo.
- I want to automatically bump up the version in main branch (possibly as a part of build pipeline job) when feature branch is merged into it.
- I want changelog to get updated automatically in main branch
I figured out that we need to have conventional commits enabled to achieve that. I tried to achieve this using pre-commit hook of git-conventional-commits, and then with commitizen but ran into problems related to plugins themselves. Moreover, I was able to achieve enforcement of conventional commits in local but can't force that on remote.
I just want to implement Semantic Versioning in the project and leverage conventional commits to auto bump up the version and auto-generate changelog. Commitizen seems like a good option, but I am facing issues with it in local where it fails to push to remote because older commits do not follow the standard commit convention.
Is there a way(maybe an extension in marketplace) which can help me achieve this?
Update-1: I did not configure anything in local and let all the commits get pushed. Instead, I implemented version update using commitizen only on main branch which means all I need to take care is that no-one commits on main branch, I squash all commits while merging PR and PR title should follow the commit convention.
Update-2: I added a PR validation pipeline to validate the title. But during the PR completion, Azure makes a special merge commit with format '<Merged PR #PR_NUMBER> ', which breaks the conventional commit convention. I am trying to override this commit using api calls but no luck yet.