-
What is it?
Conventional Commits is a specification for writing meaningful and structured commit messages. -
How does it work?
Semantic Release automates the versioning and release process based on Conventional Commits. -
Suggested Preset:
It is recommended to start with the Conventional Changelog Preset for consistency.
main
branch: Contains deployable code only.dev
branch: Contains ongoing development code.release
branch: Contains code planned for deployment (to be merged intomain
).hotfix/*
branches: Contain urgent fixes for themain
branch. Merging intomain
triggers a new release.(fix/feature/task)/*
branches: Contain changes for specific features, tasks, or fixes.
-
Main (
main
):- Houses production-ready code.
- Accepts pull requests (PRs) from
release
andhotfix/*
branches. - After a PR is closed:
- Automatically triggers the release workflow.
- Runs fully automated jobs, followed by a manual review by the deploy manager for the final
deploy
job. - The last job creates a tag, prepares release notes, updates the changelog, and releases the required components.
- Post-release, the
dev
branch is automatically rebased ontomain
.
-
Release (
release
):- Created from
dev
to prepare a deployable candidate. - PRs from
release
tomain
must be completed with merge or rebase and merge. (Consider using "rebase and merge" if you want a cleaner history without merge commits.)
- Created from
-
Hotfix (
hotfix/*
):- Created from
main
for urgent production fixes. - PRs from
hotfix/*
tomain
must use squash commits. - The squash commit title must adhere to the Conventional Commits specification.
- Created from
-
Development (
dev
):- Contains ongoing development.
- Each commit triggers a development deployment.
-
Feature/Task/Fix (
(fix/feature/task)/*
):- Created to implement features, tasks, or bug fixes.
- PRs from these branches into
dev
must use squash commits. - The squash commit title must adhere to the Conventional Commits specification.
To enforce consistent commit messages and streamline the workflow:
- Use the following command to enable hooks:
git config core.hooksPath .githooks