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
23 changes: 20 additions & 3 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ rules:
# Run `npx commitlint --print-config` to see the current setting for all
# rules.
#
body-leading-blank: [2, always]
footer-leading-blank: [2, always]
type-enum: [2, always, [build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test]]
header-max-length: [2, always, 100] # Header can not exceed 100 chars

type-case: [2, always, lower-case] # Type must be lower case
type-empty: [2, never] # Type must not be empty

# Supported conventional commit types
type-enum: [2, always, [build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test]]

scope-case: [2, always, lower-case] # Scope must be lower case

# Error if subject is one of these cases (encourages lower-case)
subject-case: [2, never, [sentence-case, start-case, pascal-case, upper-case]]
subject-empty: [2, never] # Subject must not be empty
subject-full-stop: [2, never, "."] # Subject must not end with a period

body-leading-blank: [2, always] # Body must have a blank line before it
body-max-line-length: [2, always, 100] # Body lines can not exceed 100 chars

footer-leading-blank: [2, always] # Footer must have a blank line before it
footer-max-line-length: [2, always, 100] # Footer lines can not exceed 100 chars
43 changes: 24 additions & 19 deletions .github/workflows/enforce_conventional_commits.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: Conventional Commits
---
name: Conventional Commits

on:
pull_request:
branches:
- main
permissions:
contents: read

jobs:
commit-lint:
name: Verify Conventional Commits
on:
pull_request:
branches:
- main

if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
jobs:
commit-lint:
name: Verify Conventional Commits

runs-on: ubuntu-latest
# Skip this job if this is a release PR
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))

steps:
- name: Checkout
uses: actions/checkout@v4
with: { fetch-depth: 0 }
runs-on: ubuntu-latest

- name: Check Commit Messages
uses: wagoid/commitlint-github-action@v6
with: { configFile: .commitlintrc.yml }
steps:
- name: Checkout
uses: actions/checkout@v4
with: { fetch-depth: 0 }

- name: Check Commit Messages
uses: wagoid/commitlint-github-action@v6
with: { configFile: .commitlintrc.yml }
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
}
],
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
}