mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-07 20:57:49 +00:00
chore: enable chagesets (#1211)
This commit is contained in:
13
scripts/post-changeset.js
Normal file
13
scripts/post-changeset.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const generatedLogs = fs.readFileSync('./packages/cli/CHANGELOG.md').toString();
|
||||
const [, log] = generatedLogs.split('\n## ', 2);
|
||||
const mainChangelog = fs.readFileSync('./docs/changelog.md').toString();
|
||||
const [date] = new Date().toISOString().split('T');
|
||||
const logWithDate = log.replace('\n', ' (${date})\n');
|
||||
const modifiedChangelog = mainChangelog.replace(
|
||||
'<!-- do-not-remove -->\n',
|
||||
'<!-- do-not-remove -->\n\n## ' + logWithDate
|
||||
);
|
||||
|
||||
fs.writeFileSync('./docs/changelog.md', modifiedChangelog);
|
||||
Reference in New Issue
Block a user