diff --git a/dist/index.js b/dist/index.js index b40564b..3bf72ca 100644 --- a/dist/index.js +++ b/dist/index.js @@ -111,10 +111,8 @@ async function createMarkdownFile(articles, outputDir, branch, conventionalCommi const filePath = `${outputDir}/${fileName}.md`; // Check if the markdown file already exists if (!fs.existsSync(filePath)) { - let commitMessage = `Update ${fileName} markdown file`; - if (conventionalCommits) { - commitMessage = `chore: ${commitMessage.toLowerCase()}`; - } + // Use predefined commit message + const commitMessage = `Update ${fileName} markdown file`; const markdownContent = `--- title: "${article.title}" description: "${article.description}" @@ -206,8 +204,8 @@ const exec = __importStar(__nccwpck_require__(1514)); function getFileNameFromTitle(title) { // Replace spaces and special characters with underscores return title - .replace(/[^\w\s]/gi, "_") - .replace(/\s+/g, "_") + .replace(/[^\w\s]/gi, " ") + .replace(/\s+/g, " ") .toLowerCase(); } exports.getFileNameFromTitle = getFileNameFromTitle; diff --git a/dist/utils/createMarkdownFile.js b/dist/utils/createMarkdownFile.js index c83ff7e..1ca6550 100644 --- a/dist/utils/createMarkdownFile.js +++ b/dist/utils/createMarkdownFile.js @@ -44,10 +44,8 @@ async function createMarkdownFile(articles, outputDir, branch, conventionalCommi const filePath = `${outputDir}/${fileName}.md`; // Check if the markdown file already exists if (!fs.existsSync(filePath)) { - let commitMessage = `Update ${fileName} markdown file`; - if (conventionalCommits) { - commitMessage = `chore: ${commitMessage.toLowerCase()}`; - } + // Use predefined commit message + const commitMessage = `Update ${fileName} markdown file`; const markdownContent = `--- title: "${article.title}" description: "${article.description}" diff --git a/dist/utils/git.js b/dist/utils/git.js index c7a0865..d69fa24 100644 --- a/dist/utils/git.js +++ b/dist/utils/git.js @@ -29,8 +29,8 @@ const exec = __importStar(require("@actions/exec")); function getFileNameFromTitle(title) { // Replace spaces and special characters with underscores return title - .replace(/[^\w\s]/gi, "_") - .replace(/\s+/g, "_") + .replace(/[^\w\s]/gi, " ") + .replace(/\s+/g, " ") .toLowerCase(); } exports.getFileNameFromTitle = getFileNameFromTitle; diff --git a/src/utils/createMarkdownFile.ts b/src/utils/createMarkdownFile.ts index 5ecc3a7..f2e0ec1 100644 --- a/src/utils/createMarkdownFile.ts +++ b/src/utils/createMarkdownFile.ts @@ -2,10 +2,10 @@ import * as fs from "fs" import * as core from "@actions/core" import { gitAdd, - gitCommit, gitPush, getFileNameFromTitle, - gitConfig + gitConfig, + gitCommit } from "./git" export async function createMarkdownFile( @@ -33,11 +33,8 @@ export async function createMarkdownFile( // Check if the markdown file already exists if (!fs.existsSync(filePath)) { - let commitMessage = `Update ${fileName} markdown file` - - if (conventionalCommits) { - commitMessage = `chore: ${commitMessage.toLowerCase()}` - } + // Use predefined commit message + const commitMessage = `Update ${fileName} markdown file` const markdownContent = `--- title: "${article.title}" diff --git a/src/utils/git.ts b/src/utils/git.ts index ed059d0..510368e 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -4,8 +4,8 @@ import * as exec from "@actions/exec" export function getFileNameFromTitle(title: string): string { // Replace spaces and special characters with underscores return title - .replace(/[^\w\s]/gi, "_") - .replace(/\s+/g, "_") + .replace(/[^\w\s]/gi, " ") + .replace(/\s+/g, " ") .toLowerCase() }