Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix: clone commit on release config #192

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,46 @@ module.exports = {
writerOpts: {
commitsSort: ['subject', 'scope'],
transform: (commit) => {
commit.notes.forEach((note) => {
const clonedCommit = { ...commit };

clonedCommit.notes.forEach((note) => {
note.title = 'BREAKING CHANGES';
});

if (commit.type === 'feat') {
commit.type = '✨ Features';
} else if (commit.type === 'style') {
commit.type = '🎨 Styles';
} else if (commit.type === 'test') {
commit.type = '🧪 Tests';
} else if (commit.type === 'refactor') {
commit.type = '♻️ Code Refactoring';
} else if (commit.type === 'fix') {
commit.type = '🐛 Bug Fixes';
} else if (commit.type === 'docs') {
commit.type = '📚 Documentation';
} else if (commit.type === 'perf') {
commit.type = '🚀 Performance Improvements';
} else if (commit.type === 'build') {
commit.type = '🏗️‍ Build System';
} else if (commit.type === 'ci') {
commit.type = '💻 Continuous Integration';
} else if (commit.type === 'Chore') {
commit.type = '🎒 Continuous Integration';
} else if (commit.type === 'revert') {
commit.type = '⏪ Reverts';
if (clonedCommit.type === 'feat') {
clonedCommit.type = '✨ Features';
} else if (clonedCommit.type === 'style') {
clonedCommit.type = '🎨 Styles';
} else if (clonedCommit.type === 'test') {
clonedCommit.type = '🧪 Tests';
} else if (clonedCommit.type === 'refactor') {
clonedCommit.type = '♻️ Code Refactoring';
} else if (clonedCommit.type === 'fix') {
clonedCommit.type = '🐛 Bug Fixes';
} else if (clonedCommit.type === 'docs') {
clonedCommit.type = '📚 Documentation';
} else if (clonedCommit.type === 'perf') {
clonedCommit.type = '🚀 Performance Improvements';
} else if (clonedCommit.type === 'build') {
clonedCommit.type = '🏗️‍ Build System';
} else if (clonedCommit.type === 'ci') {
clonedCommit.type = '💻 Continuous Integration';
} else if (clonedCommit.type === 'Chore') {
clonedCommit.type = '🎒 Continuous Integration';
} else if (clonedCommit.type === 'revert') {
clonedCommit.type = '⏪ Reverts';
}

if (commit.scope === '*') {
commit.scope = '';
if (clonedCommit.scope === '*') {
clonedCommit.scope = '';
}

if (typeof commit.hash === 'string') {
commit.shortHash = commit.hash.substring(0, 7);
if (typeof clonedCommit.hash === 'string') {
clonedCommit.shortHash = clonedCommit.hash.substring(0, 7);
}

if (typeof commit.subject === 'string') {
commit.subject = commit.subject.substring(0, 72);
if (typeof clonedCommit.subject === 'string') {
clonedCommit.subject = clonedCommit.subject.substring(0, 72);
}

return commit;
Expand Down