Skip to content

Commit fd1305c

Browse files
Merge pull request #11 from centralnicgroup-opensource/RSRMID-1616-Changemanagement-Notification-Extending-Further-fix
fix(notes.js): ignore release date if missing
2 parents 9e30a61 + 791d71b commit fd1305c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
10.4 KB
Loading

lib/notes.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ function getNotes() {
88
const result = cleanedNotes.match(regex); // extract the commit data as an array
99
cleanedNotes = '';
1010
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
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
1414
});
1515

1616
// Return the cleaned release notes.
1717
return `Changelog:\n\n${cleanedNotes}`;
1818
}
1919

2020
function getReleaseDate() {
21-
let cleanedNotes = decodeURIComponent(arg.notes);
22-
const regex = /\(\d{4}-\d{2}-\d{2}\)/; // match the date in parentheses
23-
const result = cleanedNotes.match(regex); // extract the date as a string
24-
cleanedNotes = result[0].replace(/\(|\)/g, ''); // remove the parentheses
25-
return cleanedNotes; // return the date
21+
const cleanedNotes = decodeURIComponent(arg.notes);
22+
const regex = /\(\d{4}-\d{2}-\d{2}\)/; // Match the date in parentheses
23+
const result = cleanedNotes.match(regex); // Extract the date as a string
24+
25+
return result?.length ? `(${result[0].replace(/\(|\)/g, '')})` : ""; // Remove the parentheses and return the date
2626
}
2727

2828
function getArguments(repoUrl) {

0 commit comments

Comments
 (0)