diff --git a/.commitlintrc.yml b/.commitlintrc.yml index 5225936..99387ba 100644 --- a/.commitlintrc.yml +++ b/.commitlintrc.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/enforce_conventional_commits.yml b/.github/workflows/enforce_conventional_commits.yml index 8e85bdb..8790db3 100644 --- a/.github/workflows/enforce_conventional_commits.yml +++ b/.github/workflows/enforce_conventional_commits.yml @@ -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 } \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json index 1898f9b..d58e7c0 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -33,4 +33,4 @@ } ], "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" -} +} \ No newline at end of file