diff --git a/dist/index.js b/dist/index.js index 20b02b4a1..e02646990 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31594,6 +31594,8 @@ class CommitCheckUseCase { constructor() { this.taskId = 'CommitCheckUseCase'; this.issueRepository = new issue_repository_1.IssueRepository(); + this.mergeBranchPattern = 'Merge branch '; + this.ghAction = 'gh-action: '; this.separator = '------------------------------------------------------'; } async invoke(param) { @@ -31631,11 +31633,13 @@ ${this.separator} - ${commit.id} by **${commit.author.name}** (@${commit.author.username}) \`\`\` -${commit.message} +${commit.message.replaceAll(`${commitPrefix}: `, '')} \`\`\` `; - if (commit.message.indexOf(commitPrefix) !== 0 && commitPrefix.length > 0) { + if ((commit.message.indexOf(commitPrefix) !== 0 && commitPrefix.length > 0) + && commit.message.indexOf(this.mergeBranchPattern) !== 0 + && commit.message.indexOf(this.ghAction) !== 0) { shouldWarn = true; } } diff --git a/src/data/usecase/commit_check_use_case.ts b/src/data/usecase/commit_check_use_case.ts index af6975a1b..c28c91c5f 100644 --- a/src/data/usecase/commit_check_use_case.ts +++ b/src/data/usecase/commit_check_use_case.ts @@ -8,7 +8,8 @@ import {ExecuteScriptUseCase} from "./steps/execute_script_use_case"; export class CommitCheckUseCase implements ParamUseCase { taskId: string = 'CommitCheckUseCase'; private issueRepository = new IssueRepository(); - + private mergeBranchPattern = 'Merge branch ' + private ghAction = 'gh-action: ' private separator = '------------------------------------------------------' async invoke(param: Execution): Promise { @@ -52,11 +53,15 @@ ${this.separator} - ${commit.id} by **${commit.author.name}** (@${commit.author.username}) \`\`\` -${commit.message} +${commit.message.replaceAll(`${commitPrefix}: `, '')} \`\`\` `; - if (commit.message.indexOf(commitPrefix) !== 0 && commitPrefix.length > 0) { + if ( + (commit.message.indexOf(commitPrefix) !== 0 && commitPrefix.length > 0) + && commit.message.indexOf(this.mergeBranchPattern) !== 0 + && commit.message.indexOf(this.ghAction) !== 0 + ) { shouldWarn = true; } }