Skip to content
Latchkey

wagoid/commitlint-github-action "subject may not be empty"

commitlint validates commit messages against a config (commonly conventional). A message missing a subject after the type fails the subject-empty rule.

What this error means

commitlint fails the PR with "subject may not be empty" and "type may not be empty".

github-actions
⧗   input: fix:
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]

Common causes

Empty subject after type

A message like "fix:" has a type but no descriptive subject.

Non-conventional format

A message without a recognized type/subject structure violates the conventional config.

How to fix it

Write a conventional message and lint the right range

  1. Use "type: subject", for example "fix: handle empty cache key".
  2. Ensure the action validates the PR commit range (fetch-depth: 0 for the full range).
  3. Re-run after amending or adding a valid commit.
.github/workflows/commitlint.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6

How to prevent it

  • Document the commit format and add a local commit-msg hook.
  • Use fetch-depth: 0 so commitlint sees the full PR range.

Frequently asked questions

What causes ""subject may not be empty [subject-empty]""?
A message like "fix:" has a type but no descriptive subject.
How do I fix "subject may not be empty [subject-empty]"?
Write a conventional message and lint the right range

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card