Catch the case when the regex fails.

This commit is contained in:
Manuele Simi 2020-06-06 15:43:55 -04:00
parent 86ff691559
commit 53a541f5b0
1 changed files with 3 additions and 1 deletions

View File

@ -173,7 +173,9 @@ String get_changelog(repo_name) {
String extract(log_content, tag, gCube_release_version, component) {
def matcher = "${log_content}" =~ /(?im)\[v${tag}\]\s\[r${gCube_release_version}\](.*)\[v.*\]\s\[r.*\]/
matcher.find()
if (!matcher.find()) {
return 'NA'
}
assert matcher[0]: "Missing release notes for ${component}"
return matcher[0]
}