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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This GitHub Action enforces consistent commit message formatting for Qualcomm pr
- Commit Subject : Verifies that a subject line is present and does not exceed the specified character limit.
- Commit Body : Ensures a body is provided and that each line adheres to the defined word wrap limit.
- Check Blank Line Flag: When true, ensures a blank line between the commit subject, body, and Signed-off-by signature for better readability.
- Strict Line Length Check Flag: When false, allows exceeding the character limit if the last word is a single token.

# Usage
Create a new GitHub Actions workflow in your project, e.g. at .github/workflows/commit-check.yml
Expand Down Expand Up @@ -33,8 +34,9 @@ Create a new GitHub Actions workflow in your project, e.g. at .github/workflows/
base: ${{ github.event.pull_request.base.sha }}
head: ${{ github.event.pull_request.head.sha }}
body-char-limit: 72
sub-char-limit: 50
sub-char-limit: 72
check-blank-line: true
strict-line-length-check: true



Expand Down
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ inputs:

sub-char-limit:
required: false
default: "50"
default: "72"
description: "Character limit for subject"

check-blank-line:
required: false
default: "true"
description: "check for a blank line between commit title and body"

strict-line-length-check:
required: false
default: "true"
description: "When false, allows exceeding the character limit if the last word is a single token"

runs:
using: "composite"
Expand Down Expand Up @@ -54,4 +59,5 @@ runs:
--head "${{ inputs.head }}" \
--body-limit "${{ inputs.body-char-limit }}" \
--sub-limit "${{ inputs.sub-char-limit }}" \
--check-blank-line "${{ inputs.check-blank-line }}"
--check-blank-line "${{ inputs.check-blank-line }}" \
--strict-line-length-check "${{ inputs.strict-line-length-check }}"
2 changes: 1 addition & 1 deletion check_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def parse_arguments():
"--head", required=True, help="Head SHA for the range (or single ref)"
)
parser.add_argument("--body-limit", type=int, default=72)
parser.add_argument("--sub-limit", type=int, default=50)
parser.add_argument("--sub-limit", type=int, default=72)
parser.add_argument("--check-blank-line", type=str, default="true")
parser.add_argument("--strict-line-length-check", type=str, default="true")
return parser.parse_args()
Expand Down
Loading