From 727fe7d82793e26dc13203da4c86bcaf61e28845 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Wed, 19 Oct 2022 17:29:01 +0200 Subject: [PATCH] - 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 --- src/transform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transform.ts b/src/transform.ts index 7fba0e0..9a03789 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -337,7 +337,7 @@ function replacePlaceholders( if (transformer?.pattern) { const extractedValue = value.replace(transformer.pattern, transformer.target) // 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) { createOrSet(placeholderPrMap, placeholder.name, extractedValue) }