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