mirror of
https://github.com/peakoss/anti-slop
synced 2026-12-01 13:39:13 +08:00
feat(inputs): add maxCommitMessageLength option
This commit is contained in:
4 files changed
+8
No files matched your search
@@ -98,6 +98,10 @@ inputs:
|
||||
default: "0"
|
||||
|
||||
# Commit Message Checks
|
||||
max-commit-message-length:
|
||||
description: Maximum allowed character length for individual commit messages. 0 disables this check.
|
||||
required: false
|
||||
default: "500"
|
||||
require-conventional-commits:
|
||||
description: Require all commit messages to follow Conventional Commits format (e.g. 'feat:', 'fix:', 'feat(scope):').
|
||||
required: false
|
||||
|
||||
@@ -32,6 +32,7 @@ export enum Input {
|
||||
MaxAdditionalPrTemplateSections = "max-additional-pr-template-sections",
|
||||
|
||||
// Commit Message Checks
|
||||
MaxCommitMessageLength = "max-commit-message-length",
|
||||
RequireConventionalCommits = "require-conventional-commits",
|
||||
RequireCommitAuthorMatch = "require-commit-author-match",
|
||||
BlockedCommitAuthors = "blocked-commit-authors",
|
||||
|
||||
@@ -56,6 +56,7 @@ export function getSettings(): Settings {
|
||||
),
|
||||
|
||||
// Commit Message Checks
|
||||
maxCommitMessageLength: parseInt(core.getInput(Input.MaxCommitMessageLength)),
|
||||
requireConventionalCommits: core.getBooleanInput(Input.RequireConventionalCommits),
|
||||
requireCommitAuthorMatch: core.getBooleanInput(Input.RequireCommitAuthorMatch),
|
||||
blockedCommitAuthors: parseList(core.getInput(Input.BlockedCommitAuthors)),
|
||||
@@ -153,6 +154,7 @@ function validateSettings(settings: Settings): void {
|
||||
0,
|
||||
50,
|
||||
);
|
||||
validateNumber(settings.maxCommitMessageLength, "max-commit-message-length", 0, 10000);
|
||||
validateNumber(settings.minRepoMergedPrs, "min-repo-merged-prs", 0, 20);
|
||||
validateNumber(settings.minRepoMergeRatio, "min-repo-merge-ratio", 0, 100);
|
||||
validateNumber(settings.minGlobalMergeRatio, "min-global-merge-ratio", 0, 100);
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface Settings {
|
||||
maxAdditionalPrTemplateSections: number;
|
||||
|
||||
// Commit Message Checks
|
||||
maxCommitMessageLength: number;
|
||||
requireConventionalCommits: boolean;
|
||||
requireCommitAuthorMatch: boolean;
|
||||
blockedCommitAuthors: string[];
|
||||
|
||||
Reference in new issue
Block a user