@@ -6,12 +6,14 @@ function getNotes() {
6
6
// Define the regex to match links and commit ids in the notes.
7
7
const regex = / \* \* ( [ ^ : ] + ) : \* \* ( .* ) \( \[ ( [ a - f 0 - 9 ] { 7 } ) \] \( .* ?\) \) / g; // match the commit data with category and message
8
8
const result = cleanedNotes . match ( regex ) ; // extract the commit data as an array
9
- cleanedNotes = '' ;
10
- result . forEach ( item => {
11
- item = item . replace ( / \( \[ ( [ a - f 0 - 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 - f 0 - 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
+ }
15
17
16
18
// Return the cleaned release notes.
17
19
return `Changelog:\n\n${ cleanedNotes } ` ;
@@ -41,9 +43,10 @@ function getArguments(repoUrl) {
41
43
releaseType = "Patch Release:" ;
42
44
headerColor = "attention" ;
43
45
}
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 ( ! / t p p | i b s / i. test ( hasModule ) && / \d + \. \d + \. \d + / . test ( versionNumber ) ) {
47
50
releaseUrl = `${ repoUrl } /releases/tag/v${ versionNumber } ` ;
48
51
}
49
52
let repoImg = "" ;
0 commit comments