Add check that timestamp has been set before generating MD version
This commit is contained in:
@@ -139,7 +139,12 @@ CHANGELOG
|
||||
`;
|
||||
|
||||
_.each(changelogs, changelog => {
|
||||
const date = moment(changelog.timestamp, 'X').format('MMMM D, YYYY');
|
||||
if (_.isUndefined(changelog.timestamp)) {
|
||||
throw new Error(
|
||||
'All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version',
|
||||
);
|
||||
}
|
||||
const date = moment(`${changelog.timestamp}`, 'X').format('MMMM D, YYYY');
|
||||
const title = `\n## v${changelog.version} - _${date}_\n\n`;
|
||||
changelogMd += title;
|
||||
|
||||
|
Reference in New Issue
Block a user