fix: existing-changelog
This commit is contained in:
parent
f4f1888468
commit
32b76499d9
@ -1,5 +1,6 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
async function fetchData(siteConfig) {
|
async function fetchData(siteConfig) {
|
||||||
const owner = siteConfig.organizationName;
|
const owner = siteConfig.organizationName;
|
||||||
@ -70,6 +71,14 @@ async function fetchData(siteConfig) {
|
|||||||
// Process the GitHub releases data here
|
// Process the GitHub releases data here
|
||||||
for (const release of releases) {
|
for (const release of releases) {
|
||||||
const version = release.tag_name;
|
const version = release.tag_name;
|
||||||
|
|
||||||
|
// Check if the changelog file already exists for the current version
|
||||||
|
const existingChangelogPath = path.join(outputDirectory, `changelog-${version}.mdx`);
|
||||||
|
if (fs.existsSync(existingChangelogPath)) {
|
||||||
|
console.log(`Changelog for version ${version} already exists. Skipping...`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const releaseUrl = release.html_url;
|
const releaseUrl = release.html_url;
|
||||||
const issueNumberMatch = release.body.match(/#(\d+)/);
|
const issueNumberMatch = release.body.match(/#(\d+)/);
|
||||||
const issueNumber = issueNumberMatch ? parseInt(issueNumberMatch[1], 10) : null;
|
const issueNumber = issueNumberMatch ? parseInt(issueNumberMatch[1], 10) : null;
|
||||||
@ -94,4 +103,4 @@ async function fetchData(siteConfig) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = fetchData;
|
module.exports = fetchData;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user