pull-request-name-linter-action icon indicating copy to clipboard operation
pull-request-name-linter-action copied to clipboard

`Error: RangeError: Found invalid rule names: header-trim`

Open maninak opened this issue 1 year ago • 2 comments
trafficstars

A CI job for my PR started suddenly failing with the error:

Run JulienKode/[email protected]
Error: RangeError: Found invalid rule names: header-trim. Supported rule names are: body-case, body-empty, body-full-stop, body-leading-blank, body-max-length, body-max-line-length, body-min-length, footer-empty, footer-leading-blank, footer-max-length, footer-max-line-length, footer-min-length, header-case, header-full-stop, header-max-length, header-min-length, references-empty, scope-case, scope-empty, scope-enum, scope-max-length, scope-min-length, signed-off-by, subject-case, subject-empty, subject-full-stop, subject-max-length, subject-min-length, subject-exclamation-mark, trailer-exists, type-case, type-empty, type-enum, type-max-length, type-min-length
Error: Found invalid rule names: header-trim. Supported rule names are: body-case, body-empty, body-full-stop, body-leading-blank, body-max-length, body-max-line-length, body-min-length, footer-empty, footer-leading-blank, footer-max-length, footer-max-line-length, footer-min-length, header-case, header-full-stop, header-max-length, header-min-length, references-empty, scope-case, scope-empty, scope-enum, scope-max-length, scope-min-length, signed-off-by, subject-case, subject-empty, subject-full-stop, subject-max-length, subject-min-length, subject-exclamation-mark, trailer-exists, type-case, type-empty, type-enum, type-max-length, type-min-length

I hadn't changed my PR's title before and it's been passing for weeks. Then it started failing for no apparent reason. (I at first tried to shorten my PR title thinking that that was the issue but after reading the error better I realized there's more to it...)

here's my pr-linting.yaml

name: PR linting
on:
  pull_request:
    types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
  lint-pr-title:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Install Dependencies
      run: npm install @commitlint/config-conventional
    - uses: JulienKode/[email protected]

and my PR title is

feat(patch-detail): implement new view with in-depth patch info

maninak avatar Jan 31 '24 15:01 maninak

The following workaround fixed it for me:

name: PR linting
on:
  pull_request:
    types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
  lint-pr-title:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Install Dependencies
-      run: npm install @commitlint/config-conventional
+      run: npm install @commitlint/config-conventional@v17
    - uses: JulienKode/[email protected]

maninak avatar Jan 31 '24 15:01 maninak

A new rule was introduced in v18.6 https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md#1860-2024-01-25

iustin-nita avatar Feb 01 '24 12:02 iustin-nita