@@ -29029,6 +29029,7 @@ class Inputs {
29029
29029
this.allowOneLiners = values.allowOneLiners;
29030
29030
this.additionalVerbs = values.additionalVerbs;
29031
29031
this.maxSubjectLength = values.maxSubjectLength;
29032
+ this.minBodyLength = values.minBodyLength;
29032
29033
this.maxBodyLineLength = values.maxBodyLineLength;
29033
29034
this.enforceSignOff = values.enforceSignOff;
29034
29035
this.validatePullRequestCommits = values.validatePullRequestCommits;
@@ -29078,7 +29079,7 @@ function parseIntOrInfinity(text) {
29078
29079
return parseInt(text, 10);
29079
29080
}
29080
29081
function parseInputs(rawInputs) {
29081
- const { additionalVerbsInput = '', pathToAdditionalVerbsInput = '', allowOneLinersInput = '', maxSubjectLengthInput = '', maxBodyLineLengthInput = '', enforceSignOffInput = '', validatePullRequestCommitsInput = '', skipBodyCheckInput = '', ignoreMergeCommitsInput = '', ignorePatternsInput = '', } = rawInputs;
29082
+ const { additionalVerbsInput = '', pathToAdditionalVerbsInput = '', allowOneLinersInput = '', maxSubjectLengthInput = '', minBodyLengthInput = '', maxBodyLineLengthInput = '', enforceSignOffInput = '', validatePullRequestCommitsInput = '', skipBodyCheckInput = '', ignoreMergeCommitsInput = '', ignorePatternsInput = '', } = rawInputs;
29082
29083
const additionalVerbs = new Set();
29083
29084
const hasAdditionalVerbsInput = additionalVerbsInput.length > 0;
29084
29085
if (additionalVerbsInput) {
@@ -29110,6 +29111,13 @@ function parseInputs(rawInputs) {
29110
29111
return new MaybeInputs(null, 'Unexpected value for max-subject-line-length. ' +
29111
29112
`Expected a number or nothing, got ${maxSubjectLengthInput}`);
29112
29113
}
29114
+ const minBodyLength = !minBodyLengthInput
29115
+ ? 0
29116
+ : parseInt(minBodyLengthInput, 10);
29117
+ if (Number.isNaN(minBodyLength)) {
29118
+ return new MaybeInputs(null, 'Unexpected value for min-body-length. ' +
29119
+ `Expected a number or nothing, got ${minBodyLengthInput}`);
29120
+ }
29113
29121
const maxBodyLineLength = !maxBodyLineLengthInput
29114
29122
? 72
29115
29123
: parseIntOrInfinity(maxBodyLineLengthInput);
@@ -29158,6 +29166,7 @@ function parseInputs(rawInputs) {
29158
29166
allowOneLiners,
29159
29167
additionalVerbs,
29160
29168
maxSubjectLength,
29169
+ minBodyLength,
29161
29170
maxBodyLineLength,
29162
29171
enforceSignOff,
29163
29172
validatePullRequestCommits,
@@ -29380,6 +29389,15 @@ function checkBody(subject, bodyLines, inputs) {
29380
29389
errors.push('Unexpected empty body');
29381
29390
return errors;
29382
29391
}
29392
+ // Minimum character body length
29393
+ if (inputs.minBodyLength) {
29394
+ const bodyLength = bodyLines.join(' ').length;
29395
+ if (bodyLength < inputs.minBodyLength) {
29396
+ errors.push(`The body must contain at least ${inputs.minBodyLength} characters. ` +
29397
+ `The body contains ${bodyLength} characters.`);
29398
+ return errors;
29399
+ }
29400
+ }
29383
29401
for (const [i, line] of bodyLines.entries()) {
29384
29402
if (urlLineRe.test(line) || linkDefinitionRe.test(line)) {
29385
29403
continue;
@@ -29574,6 +29592,9 @@ async function runWithExceptions() {
29574
29592
const maxSubjectLengthInput = core.getInput('max-subject-line-length', {
29575
29593
required: false,
29576
29594
});
29595
+ const minBodyLengthInput = core.getInput('min-body-length', {
29596
+ required: false,
29597
+ });
29577
29598
const maxBodyLineLengthInput = core.getInput('max-body-line-length', {
29578
29599
required: false,
29579
29600
});
@@ -29597,6 +29618,7 @@ async function runWithExceptions() {
29597
29618
pathToAdditionalVerbsInput,
29598
29619
allowOneLinersInput,
29599
29620
maxSubjectLengthInput,
29621
+ minBodyLengthInput,
29600
29622
maxBodyLineLengthInput,
29601
29623
enforceSignOffInput,
29602
29624
validatePullRequestCommitsInput,
0 commit comments