From 5f7365e8a771c07b738196b4d0110fe3bd0b061e Mon Sep 17 00:00:00 2001 From: ian-flores Date: Wed, 4 Feb 2026 09:02:31 -0800 Subject: [PATCH 1/2] ci: add PR title convention check for semantic-release Adds a GitHub Action that validates PR titles follow conventional commit format (feat:, fix:, docs:, etc.). This ensures squash merges produce commits that semantic-release can analyze for version bumps. Required because semantic-release was skipping releases when commits didn't follow the convention (e.g., PR #66's "fix tests" instead of "fix: tests"). --- .github/workflows/pr-title.yml | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 00000000..cf80c6bb --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,43 @@ +# PR Title Convention Check +# +# Ensures PR titles follow conventional commit format so that +# squash merges produce commits that semantic-release can analyze. +# +# Valid formats: +# feat: add new feature +# fix(scope): fix bug in scope +# docs: update documentation +# chore!: breaking change + +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + check-title: + runs-on: ubuntu-latest + steps: + - name: Validate PR title + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + style + refactor + perf + test + build + ci + chore + revert + requireScope: false + subjectPattern: ^.+$ + subjectPatternError: | + The subject (after the type) cannot be empty. + Example: "feat: add user authentication" From 4ef560de2f59659206554b22e973233162f8c095 Mon Sep 17 00:00:00 2001 From: ian-flores Date: Wed, 4 Feb 2026 09:08:32 -0800 Subject: [PATCH 2/2] docs: document PR title convention enforcement - Update CONTRIBUTING.md to clarify PR titles are validated by CI - Explain squash merge strategy and how it affects releases - Add PR Title Check to CI checks list - Update CLAUDE.md with summary of PR title requirements --- CLAUDE.md | 4 +++- CONTRIBUTING.md | 29 ++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3655e267..c561ded4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -42,7 +42,9 @@ helm install team-operator ./dist/chart \ ## Contributing -- Use conventional commits (`feat:`, `fix:`, `docs:`, etc.) +- **PR titles must follow conventional commit format** (`feat:`, `fix:`, `docs:`, etc.) - this is enforced by CI +- The repo uses squash merge, so PR title becomes the commit message +- semantic-release uses commit prefixes for version bumps: `feat:` = minor, `fix:` = patch, `feat!:` = major - Run `just test` before committing - See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f776c58..617aac5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -124,25 +124,30 @@ just mtest - Good: `add-workbench-scaling`, `fix-database-connection` - Avoid: `feature/workbench`, `fix/db` -### Commit Message Conventions +### PR Title Conventions (Required) -We use [Conventional Commits](https://www.conventionalcommits.org/). Each commit message should follow this format: +We use [Conventional Commits](https://www.conventionalcommits.org/) and **squash merging**. Your PR title becomes the commit message, so it must follow this format: ``` (): - -[optional body] - -[optional footer] ``` +> **Important**: PR titles are validated by CI. PRs with non-conforming titles cannot be merged. This is enforced because semantic-release uses commit messages to determine version bumps. + **Types:** -- `feat:` - New feature -- `fix:` - Bug fix +- `feat:` - New feature (triggers minor version bump) +- `fix:` - Bug fix (triggers patch version bump) - `docs:` - Documentation only changes - `refactor:` - Code change that neither fixes a bug nor adds a feature - `test:` - Adding or correcting tests -- `chore:` - Changes to the build process or auxiliary tools +- `build:` - Changes to build system or dependencies +- `ci:` - Changes to CI configuration +- `chore:` - Other changes that don't modify src or test files +- `perf:` - Performance improvements +- `style:` - Code style changes (formatting, etc.) +- `revert:` - Reverts a previous commit + +**Breaking changes**: Add `!` after the type (e.g., `feat!:`) or include `BREAKING CHANGE:` in the PR body. This triggers a major version bump. **Examples:** ``` @@ -150,6 +155,7 @@ feat(connect): add support for custom resource limits fix(workbench): resolve database connection timeout docs: update installation instructions refactor(controller): simplify reconciliation logic +feat!: change API response format ``` ### Code Style Guidelines @@ -298,6 +304,7 @@ Include the following in your PR description: The following checks must pass: +- **PR Title Check** - Title must follow conventional commit format (see above) - **Build** - The operator must compile successfully - **Unit tests** - All tests must pass - **Kustomize** - Kustomization must build without errors @@ -305,6 +312,10 @@ The following checks must pass: - **Helm template** - Templates must render correctly - **No diff** - Generated files must be committed +### Merging + +This repository uses **squash and merge**. Your PR title becomes the final commit message on `main`. This is why the PR title format is enforced - semantic-release analyzes these commit messages to determine version bumps. + ### Review Expectations - PRs require at least one approval before merging