From 342ce3ea641936fb17ee305bc2cc68114373a379 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 19 Jul 2024 10:53:51 +0200 Subject: [PATCH] DEBUG Signed-off-by: Sebastiaan van Stijn --- .github/workflows/validate-pr.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 73323ad6de2f..f7ee0abb38b6 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -57,10 +57,12 @@ jobs: id: title_branch run: | # get the intended major version prefix ("[27.1 backport]" -> "27.") from the PR title. - [[ "$PR_TITLE" =~ ^\[\([0-9]*\.\)[^]]*\] ]] && branch="${BASH_REMATCH[1]}" + [[ "$PR_TITLE" =~ ^\[\([0-9]*\.\)[^]]*\] ]] && branch="${BASH_REMATCH[1]}" || NO_BRANCH="${BASH_REMATCH[1]}" # get major version prefix from the release branch ("27.x -> "27.") - [[ "$GITHUB_BASE_REF" =~ ^\([0-9]*\.\) ]] && target_branch="${BASH_REMATCH[1]}" + [[ "$GITHUB_BASE_REF" =~ ^\([0-9]*\.\) ]] && target_branch="${BASH_REMATCH[1]}" || NO_TARGET_BRANCH="${BASH_REMATCH[1]}" + + env if [[ "$GITHUB_BASE_REF" != "$branch" ]] && ! [[ "$GITHUB_BASE_REF" == "master" && "$branch" == "" ]]; then echo "::error::PR is opened against the $GITHUB_BASE_REF branch, but its title suggests otherwise."