Skip to content
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}
Expand Down
11 changes: 8 additions & 3 deletions src/data/usecase/commit_check_use_case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {ExecuteScriptUseCase} from "./steps/execute_script_use_case";
export class CommitCheckUseCase implements ParamUseCase<Execution, Result[]> {
taskId: string = 'CommitCheckUseCase';
private issueRepository = new IssueRepository();

private mergeBranchPattern = 'Merge branch '
private ghAction = 'gh-action: '
private separator = '------------------------------------------------------'

async invoke(param: Execution): Promise<Result[]> {
Expand Down Expand Up @@ -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;
}
}
Expand Down