Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PR Title Lint

on:
pull_request:
pull_request_target:
types: [opened, edited, synchronize, reopened]
branches: [main]

Expand Down Expand Up @@ -31,15 +31,18 @@ jobs:
revert
build
requireScope: false
subjectPattern: ^[a-z].+$
subjectPattern: ^(?![A-Z][a-z]).+$
subjectPatternError: |
The subject must start with a lowercase letter.
The subject must not start with a Title Case word (e.g. "Add", "Update").
Acronyms like SHA, API, URL are fine. Lowercase starts are fine.

Examples of valid PR titles:
feat(docx-core): add paragraph diffing
fix: correct bookmark cleanup order
chore(release): bump workspace versions
ci: add PR title validation
ci: SHA-pin all GitHub Actions
feat: API migration to v2

auto-label:
name: Apply type label from PR title
Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Longer is better — think essay, not tweet.
Fixes: #42
```

**Valid types:** `feat`, `fix`, `refactor`, `test`, `docs`, `chore`, `ci`, `perf`, `style`
**Valid types:** `feat`, `fix`, `refactor`, `test`, `docs`, `chore`, `ci`, `perf`, `style`, `revert`, `build`

**Scopes** should match the package or area you're changing:
- `fix(docx-core):` — bug fix in the core OOXML library
Expand All @@ -56,10 +56,14 @@ Fixes: #42

Scope your commits to one package when possible. Cross-package changes should use the primary package as scope.

**Subject casing:** The subject (the part after the colon) must not start with a Title Case word like "Add" or "Update". Lowercase starts and all-caps acronyms (SHA, API, URL) are fine.

**Reference issues** in the commit body: `Fixes: #N` (closes the issue) or `Ref: #N` (related but doesn't close).

## Pull Request Guidelines

Pull request titles follow the same Conventional Commits format as commit messages. A CI check (`Validate conventional title`) enforces this on every PR.

- **Keep PRs small and focused.** 10 small PRs are better than 1 monolithic one.
- **A PR doesn't have to be done** — or even work — but it should represent clean progress in one direction.
- **Decompose where possible.** For example, submit regexes + tests in one PR, then the feature that uses them in another.
Expand Down
Loading