Skip to content

Commit

Permalink
Small tweak to the changelog script
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbjensen committed Sep 30, 2024
1 parent 6d98622 commit 27a9b56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/update-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const changelogPath = join(__dirname, '../CHANGELOG.md');
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
const currentVersion = packageJson.version;

// Bump patch version
const [major, minor, patch] = currentVersion.split('.').map(Number);
const nextVersion = `${major}.${minor}.${patch + 1}`;

// Get previous version from git tags
const previousVersion = execSync('git describe --tags --abbrev=0 HEAD^').toString().trim();

Expand Down Expand Up @@ -51,7 +55,7 @@ const currentDate = formatDateToString();
const changelogContent = readFileSync(changelogPath, 'utf-8');

// Create new changelog entry
const newChangelogEntry = `### ${currentVersion} - ${currentDate}
const newChangelogEntry = `### ${nextVersion} - ${currentDate}
${commitMessages}
`;
Expand Down

0 comments on commit 27a9b56

Please sign in to comment.