Skip to content

Commit

Permalink
fix: dates issues
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv committed Jan 14, 2025
1 parent b3781ec commit c766095
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions release.utils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ const customTransform = (commit, context) => {
// Create a shallow copy of the commit object
const newCommit = { ...commit };

// Validate and format the date
if (newCommit.date && !(new Date(newCommit.date) instanceof Date)) {
console.error("Invalid commit.date:", newCommit.date);
newCommit.date = new Date().toISOString(); // Default to current date if invalid
}

if (newCommit.notes) {
newCommit.notes = newCommit.notes.map((note) => ({
...note,
Expand Down Expand Up @@ -216,4 +222,5 @@ const customTransform = (commit, context) => {
};



module.exports = customTransform;

0 comments on commit c766095

Please sign in to comment.