- differentiate full match vs no match by checking the regex match when filling the placeholders
- This means that transforms which don't match to function as before, but also offers the flexibility if a match results in the equal content as the original to be handled properly - FIX https://github.com/mikepenz/release-changelog-builder-action/issues/929
This commit is contained in:
+1
-1
@@ -337,7 +337,7 @@ function replacePlaceholders(
|
|||||||
if (transformer?.pattern) {
|
if (transformer?.pattern) {
|
||||||
const extractedValue = value.replace(transformer.pattern, transformer.target)
|
const extractedValue = value.replace(transformer.pattern, transformer.target)
|
||||||
// note: `.replace` will return the full string again if there was no match
|
// note: `.replace` will return the full string again if there was no match
|
||||||
if (extractedValue && extractedValue !== value) {
|
if (extractedValue && (extractedValue !== value || (extractedValue === value && value.match(transformer.pattern)))) {
|
||||||
if (placeholderPrMap) {
|
if (placeholderPrMap) {
|
||||||
createOrSet(placeholderPrMap, placeholder.name, extractedValue)
|
createOrSet(placeholderPrMap, placeholder.name, extractedValue)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user