Skip to content

Commit

Permalink
chore: fix full release note generation [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ZheSun88 committed Nov 13, 2024
1 parent 059e5d3 commit f68d863
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions scripts/generator/src/creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,34 +157,40 @@ function createModulesReleaseNotes(versions, version, modulesReleaseNoteTemplate
let modulesReleaseNotes="";
let docLinks=[];

platformReleaseNoteBody.split("\n").forEach(
line => {
if (line.includes("https") && line.includes("docs")){
line.split("](").forEach(
l => l.split("))").filter(docs=>docs.includes("https")).forEach(
doc => docLinks.push(doc)
)
)
};
if (line.includes("https") && line.includes("tag") && !line.includes("platform")){
line.split("](").forEach(
l => l.split("))").filter(notes=>notes.includes("https")).forEach(
noteLink => {
moduleName = getModuleName(noteLink)
noteVersion = getReleaseNoteVersion(noteLink)
noteBody = getReleaseNoteBody(moduleName, noteVersion)

modulesReleaseNotes += moduleName + ' ' + noteVersion + '\n' + noteBody + '\n\n\n';
}
)
)
};
}
)

const modulesReleaseNoteData = Object.assign(versions, { modulesReleaseNotes: modulesReleaseNotes });

return render(modulesReleaseNoteTemplate, modulesReleaseNoteData);
if(platformReleaseNoteBody) {

platformReleaseNoteBody.split("\n").forEach(
line => {
if (line.includes("https") && line.includes("docs")){
line.split("](").forEach(
l => l.split("))").filter(docs=>docs.includes("https")).forEach(
doc => docLinks.push(doc)
)
)
};
if (line.includes("https") && line.includes("tag") && !line.includes("platform")){
line.split("](").forEach(
l => l.split("))").filter(notes=>notes.includes("https")).forEach(
noteLink => {
moduleName = getModuleName(noteLink)
noteVersion = getReleaseNoteVersion(noteLink)
noteBody = getReleaseNoteBody(moduleName, noteVersion)

modulesReleaseNotes += moduleName + ' ' + noteVersion + '\n' + noteBody + '\n\n\n';
}
)
)
};
}
)

const modulesReleaseNoteData = Object.assign(versions, { modulesReleaseNotes: modulesReleaseNotes });

return render(modulesReleaseNoteTemplate, modulesReleaseNoteData);
} else {
return ""
}

}

function getModuleName(link){
Expand Down

0 comments on commit f68d863

Please sign in to comment.