From 8110c13d87ecb16f60d585643bc18253bb7b3798 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Wed, 18 Jun 2025 14:30:46 +0200 Subject: [PATCH] Parse long issue reference variant from body Closes #40365 Signed-off-by: Alexander Schwartz --- .github/scripts/pr-find-issues-test.sh | 3 ++- .github/scripts/pr-find-issues.sh | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/scripts/pr-find-issues-test.sh b/.github/scripts/pr-find-issues-test.sh index 705d8adcc4a..03de462421b 100755 --- a/.github/scripts/pr-find-issues-test.sh +++ b/.github/scripts/pr-find-issues-test.sh @@ -5,7 +5,7 @@ source ./pr-find-issues.sh function testParsing() { echo -n "$1 -> $2 " - if [ $(parse_issues "$1") != "$2" ]; then + if [ "$(parse_issues "$1")" != "$2" ]; then echo "(failure)" return 1 fi @@ -22,3 +22,4 @@ trap 'testFailed' ERR testParsing "Closes #123" "123" testParsing "Fixes #123" "123" testParsing "Fixes: #123" "123" +testParsing "Fixes https://github.com/keycloak/keycloak/issues/123" "123" \ No newline at end of file diff --git a/.github/scripts/pr-find-issues.sh b/.github/scripts/pr-find-issues.sh index c91ccd85dce..e9bd720ea29 100755 --- a/.github/scripts/pr-find-issues.sh +++ b/.github/scripts/pr-find-issues.sh @@ -8,7 +8,11 @@ if [ "$REPO" == "" ]; then fi function parse_issues() { - echo "$1" | grep -i -P -o "(close|closes|closed|resolve|resolves|resolved|fixes|fixed):? #[[:digit:]]*" | cut -d '#' -f 2 | sort -n + echo "$1" | \ + grep -i -P -o "(close|closes|closed|resolve|resolves|resolved|fixes|fixed):? (#|https://github.com/keycloak/keycloak/issues/)[[:digit:]]*" | \ + sed -e 's|https://github.com/keycloak/keycloak/issues/|#|g' | \ + sed -e 's|keycloak/keycloak/issues/|#|g' | \ + cut -d '#' -f 2 | sort -n } if [ "$PR" != "" ]; then