From 40c84ee1eef4fbd8d0eb7078e836c93e633ec983 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 14 Jan 2025 12:42:04 +0400 Subject: [PATCH] chore: skip bad commits --- release.config.cjs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/release.config.cjs b/release.config.cjs index 6bac1d8..f1287d9 100644 --- a/release.config.cjs +++ b/release.config.cjs @@ -50,19 +50,18 @@ module.exports = { mergeCorrespondence: ['id', 'source'], }, writerOpts: { - transform: transform, - // Adding a fallback for Date handling to avoid the TypeError - processCommitDate: (commit) => { - if (commit.date && !(commit.date instanceof Date)) { - // If the commit date is not a valid Date, set it to a fallback Date - commit.date = new Date(commit.date); + transform: (commit) => { + try { + return commit; + } catch (error) { + // Log the error and continue processing the next commit + console.error(`Error processing commit: ${commit.message}`, error); + return null; // This will skip the problematic commit } - return commit; }, }, }, ], - '@semantic-release/changelog', [ '@semantic-release/npm',