Skip to content

Commit 825a1da

Browse files
Merge pull request #15 from centralnicgroup-opensource/RSRMID-1616-Changemanagement-Notification-Extending-Further-fix
fix(notes.js): cleanup Release notes url for IBS & TPP module
2 parents 32ab35f + 7ef8827 commit 825a1da

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

lib/notes.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ function getNotes() {
66
// Define the regex to match links and commit ids in the notes.
77
const regex = /\*\*([^:]+):\*\* (.*) \(\[([a-f0-9]{7})\]\(.*?\)\)/g; // match the commit data with category and message
88
const result = cleanedNotes.match(regex); // extract the commit data as an array
9-
cleanedNotes = '';
10-
result.forEach(item => {
11-
item = item.replace(/\(\[([a-f0-9]{7})\]\(.*?\)\)/, ''); // remove the parentheses and the commit hash
12-
item = item.trim(); // remove any extra spaces
13-
cleanedNotes += item + '\n\n'; // add the formatted item to the output string with a line break
14-
});
9+
if (result?.length) {
10+
cleanedNotes = "";
11+
result.forEach(item => {
12+
item = item.replace(/\(\[([a-f0-9]{7})\]\(.*?\)\)/, ''); // remove the parentheses and the commit hash
13+
item = item.trim(); // remove any extra spaces
14+
cleanedNotes += item + '\n\n'; // add the formatted item to the output string with a line break
15+
});
16+
}
1517

1618
// Return the cleaned release notes.
1719
return `Changelog:\n\n${cleanedNotes}`;
@@ -41,9 +43,10 @@ function getArguments(repoUrl) {
4143
releaseType = "Patch Release:";
4244
headerColor = "attention";
4345
}
44-
let releaseUrl = false;
45-
let versionNumber = arg?.update ?? "Development Changes";
46-
if (/\d+\.\d+\.\d+/.test(versionNumber)) {
46+
let releaseUrl = "";
47+
const versionNumber = arg?.update ?? "Development Changes";
48+
const hasModule = arg?.module ?? "";
49+
if (!/tpp|ibs/i.test(hasModule) && /\d+\.\d+\.\d+/.test(versionNumber)) {
4750
releaseUrl = `${repoUrl}/releases/tag/v${versionNumber}`;
4851
}
4952
let repoImg = "";

0 commit comments

Comments
 (0)