3.4 KiB
3.4 KiB
Conventional Commits Examples
This file contains examples of conventional commits that will trigger automatic releases.
Commit Types
feat: - New Features (Minor Release)
# Add new video format support
git commit -m "feat: add support for MP4 video format"
# Add new command
git commit -m "feat: add /help command for user assistance"
# Add new language support
git commit -m "feat: add Spanish language support"
fix: - Bug Fixes (Patch Release)
# Fix download issue
git commit -m "fix: resolve video download timeout issue"
# Fix memory leak
git commit -m "fix: prevent memory leak in video processing"
# Fix error handling
git commit -m "fix: improve error handling for invalid URLs"
feat!: or fix!: - Breaking Changes (Major Release)
# Breaking change in API
git commit -m "feat!: change bot command structure"
# Breaking change in configuration
git commit -m "fix!: update environment variable names"
docs: - Documentation (No Release)
# Update README
git commit -m "docs: update installation instructions"
# Add API documentation
git commit -m "docs: add API endpoint documentation"
style: - Code Style (No Release)
# Format code
git commit -m "style: format code according to prettier"
# Fix linting issues
git commit -m "style: fix ESLint warnings"
refactor: - Code Refactoring (No Release)
# Refactor download logic
git commit -m "refactor: improve video download performance"
# Restructure code
git commit -m "refactor: reorganize bot handlers"
test: - Testing (No Release)
# Add unit tests
git commit -m "test: add unit tests for download function"
# Update test configuration
git commit -m "test: update test environment setup"
chore: - Maintenance (No Release)
# Update dependencies
git commit -m "chore: update dependencies to latest versions"
# Update CI configuration
git commit -m "chore: update GitHub Actions workflow"
# Manual release
git commit -m "chore: release 1.0.0" -m "Release-As: 1.0.0"
Commit Message Format
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Examples with Scope
# With scope
git commit -m "feat(download): add support for batch downloads"
# With scope and body
git commit -m "feat(api): add rate limiting" -m "Add rate limiting to prevent abuse"
# With breaking change
git commit -m "feat(api)!: change response format" -m "BREAKING CHANGE: API response structure has changed"
Version Bumping Rules
- Patch (1.0.0 → 1.0.1):
fix:,docs:,style:,refactor:,test:,chore: - Minor (1.0.0 → 1.1.0):
feat: - Major (1.0.0 → 2.0.0):
feat!:orfix!:(breaking changes)
Best Practices
- Use present tense: "add" not "added"
- Use imperative mood: "move cursor" not "moves cursor"
- Don't capitalize the first letter: "fix: resolve issue" not "Fix: resolve issue"
- Don't end with a period: "feat: add new feature" not "feat: add new feature."
- Be descriptive: "fix: resolve memory leak in video processing" not "fix: bug"
Testing Commits
To test the release process without affecting production:
# Create a test commit
git commit -m "test: add test feature for release testing"
# Push to trigger release-please
git push origin master
# Check the created PR in GitHub
# If satisfied, merge the PR to create a release