Skip to content

Commit

Permalink
improvement(index.js): remove the check for first letter should be ca…
Browse files Browse the repository at this point in the history
…pital in commit message
  • Loading branch information
ad1992 committed Mar 26, 2020
1 parent af22bdc commit 887cfa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5332,11 +5332,6 @@ async function verifyCommits(repoToken) {
isCommitBad = true;
}

if (message[0] !== message[0].toUpperCase()) {
error(`commit message \"${message}\" should have first letter in upper case`);
isCommitBad = true;
}

const badKeywords = filterCommit(message);
if (badKeywords.length) {
error(`commit message \"${message}\" contains ${badKeywords.join()}`);
Expand All @@ -5349,7 +5344,7 @@ async function verifyCommits(repoToken) {
}
}
if (badCommits) {
throw Error(`${badCommits} have been encountered. Please fix the above errors`);
throw Error(`${badCommits} bad commit(s) encountered. Please fix the above errors`);
}
}
async function main() {
Expand All @@ -5358,7 +5353,7 @@ async function main() {
await verifyCommits(repoToken);
debug('Recieved repo token');
} catch (e) {
setFailed(`Action failed with error ${e.message}`);
setFailed(`Action failed with error: ${e.message}`);
}
}

Expand Down
9 changes: 2 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ async function verifyCommits(repoToken) {
isCommitBad = true;
}

if (message[0] !== message[0].toUpperCase()) {
error(`commit message \"${message}\" should have first letter in upper case`);
isCommitBad = true;
}

const badKeywords = filterCommit(message);
if (badKeywords.length) {
error(`commit message \"${message}\" contains ${badKeywords.join()}`);
Expand All @@ -47,7 +42,7 @@ async function verifyCommits(repoToken) {
}
}
if (badCommits) {
throw Error(`${badCommits} have been encountered. Please fix the above errors`);
throw Error(`${badCommits} bad commit(s) encountered. Please fix the above errors`);
}
}
async function main() {
Expand All @@ -56,7 +51,7 @@ async function main() {
await verifyCommits(repoToken);
debug('Recieved repo token');
} catch (e) {
setFailed(`Action failed with error ${e.message}`);
setFailed(`Action failed with error: ${e.message}`);
}
}

Expand Down

0 comments on commit 887cfa1

Please sign in to comment.