mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
CI: Remove frontmatter from release notes
This commit is contained in:
9
npm/release-notes.js
Normal file
9
npm/release-notes.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const { readFileSync, writeFileSync } = require('node:fs');
|
||||
|
||||
const { version } = require('./package.json');
|
||||
const versionWithoutPreRelease = version.replace(/-rc\.\d+$/, '');
|
||||
|
||||
const markdown = readFileSync(`./docs/src/content/docs/changelog/v${versionWithoutPreRelease}.md`, 'utf8');
|
||||
const markdownWithoutFrontmatter = markdown.replace(/---\n.*?\n---\n+/s, '');
|
||||
|
||||
writeFileSync('./release-notes.md', markdownWithoutFrontmatter);
|
||||
Reference in New Issue
Block a user