Skip to content

Commit

Permalink
chore: remove conventional commit usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal committed Feb 4, 2024
1 parent 7e093d8 commit a29118a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
10 changes: 4 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions dist/utils/createMarkdownFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions dist/utils/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 4 additions & 7 deletions src/utils/createMarkdownFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions src/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit a29118a

Please sign in to comment.