diff --git a/src/main/java/io/quarkus/bot/util/GHPullRequests.java b/src/main/java/io/quarkus/bot/util/GHPullRequests.java index ef89d9d..7904532 100644 --- a/src/main/java/io/quarkus/bot/util/GHPullRequests.java +++ b/src/main/java/io/quarkus/bot/util/GHPullRequests.java @@ -7,7 +7,7 @@ public final class GHPullRequests { - private static final Pattern CLEAN_VERSION_PATTERN = Pattern.compile("^\\[?\\(?[0-9]+\\.[0-9]+\\]?\\)?[ -]*"); + private static final Pattern CLEAN_VERSION_PATTERN = Pattern.compile("^\\[?\\(?[0-9]+\\.[0-9]+\\]?\\)?(?!\\.)[ -]*"); public static boolean hasLabel(GHPullRequest pullRequest, String labelName) { for (GHLabel label : pullRequest.getLabels()) { diff --git a/src/test/java/io/quarkus/bot/it/util/GHPullRequestsTest.java b/src/test/java/io/quarkus/bot/it/util/GHPullRequestsTest.java index d136aa4..8c776af 100644 --- a/src/test/java/io/quarkus/bot/it/util/GHPullRequestsTest.java +++ b/src/test/java/io/quarkus/bot/it/util/GHPullRequestsTest.java @@ -26,6 +26,7 @@ public void testNormalizeTitle() { assertThat(GHPullRequests.normalizeTitle("My PR", "3.10")).isEqualTo(("[3.10] My PR")); assertThat(GHPullRequests.normalizeTitle("My PR", "main")).isEqualTo(("My PR")); assertThat(GHPullRequests.normalizeTitle("(3.8) My PR", "main")).isEqualTo(("(3.8) My PR")); + assertThat(GHPullRequests.normalizeTitle("3.8.4 backports 1", "3.8")).isEqualTo(("[3.8] 3.8.4 backports 1")); assertThat(GHPullRequests.normalizeTitle("(3.10) My PR", "3.10")).isEqualTo(("[3.10] My PR")); assertThat(GHPullRequests.normalizeTitle("[3.8] My PR", "main")).isEqualTo(("[3.8] My PR")); assertThat(GHPullRequests.normalizeTitle("[3.8] My PR", "3.8")).isEqualTo(("[3.8] My PR"));