Skip to content

Commit

Permalink
fix commit message error
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-gupta7 committed Dec 30, 2024
1 parent df9515d commit 01b878d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ export class GitlabTokenStorage extends GitTokenStorage {
const sourceBranch = this.previousSourceBranch || this.source;
await this.createBranch(branch, sourceBranch);
}

const pushRules = await this.gitlabClient.ProjectPushRules.show(this.projectId);
const initialCommitMessage = pushRules?.commit_message_regex ? 'chore: Initial Commit' : 'Initial Commit';
// Directories cannot be created empty (Source: https://gitlab.com/gitlab-org/gitlab/-/issues/247503)
const pathToCreate = this.path.endsWith('.json') ? this.path : `${this.path}/.gitkeep`;
try {
Expand All @@ -226,7 +229,7 @@ export class GitlabTokenStorage extends GitTokenStorage {
pathToCreate,
branch,
'{}',
'Initial commit',
initialCommitMessage,
);
}

Expand Down

0 comments on commit 01b878d

Please sign in to comment.