Skip to content

Commit

Permalink
Allow skipping message body check (#97)
Browse files Browse the repository at this point in the history
Some organizations prefer to use only a subject
line, usually referring to the pull request, as
it provides the full context for the change.

Other reasons for using a subject line-only
include incompatibility with automatic PR bots,
like Renovate. Besides this, most teams today use
some UI to read the PR's message body
(i.e., GitHub), so restricting what can be added
to a PR message can lead to a poor
user experience.

Signed-off-by: Marcos Passos <[email protected]>
  • Loading branch information
marcospassos authored Feb 14, 2022
1 parent e3bda63 commit c5cea9a
Show file tree
Hide file tree
Showing 9 changed files with 1,415 additions and 1,317 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ and more verbose body for an informative Git history. However, this might be
too rigid for certain projects.

You can allow one-liner commit messages by setting the flag `allow-one-liners`:

```yaml
steps:
- name: Check
Expand All @@ -158,6 +158,22 @@ You can allow one-liner commit messages by setting the flag `allow-one-liners`:
allow-one-liners: 'true'
```

## Skip Body Check

For some repositories only the subject matters while the body is allowed to be free-form.
For example, this is the case when the body of the commit is automatically generated (*e.g.*, by a third-party service that we do not control).
In such situations, we want check the subject line, but ignore the body in the checks.

You can disable checking the body by setting the flag `skip-body-check`:

```yaml
steps:
- name: Check
uses: mristin/opinionated-commit-message@v2
with:
skip-body-check: 'true'
```

## Enforce Sign-off

Most projects do not require a sign-off on the commits.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ inputs:
description: 'If set to "true", signed-off-by is required in the commit message body'
required: false
default: ''
skip-body-check:
description: 'If set to "true", skip the body check'
required: false
default: ''
Loading

0 comments on commit c5cea9a

Please sign in to comment.