File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,12 +57,12 @@ jobs:
5757 id : title_branch
5858 run : |
5959 # get the intended major version prefix ("[27.1 backport]" -> "27.") from the PR title.
60- [[ "$PR_TITLE" =~ ^\[\ ([0-9]*\.\ )[^]]*\] ]] && branch="${BASH_REMATCH[1]}"
60+ [[ "$PR_TITLE" =~ ^\[([0-9]*\.)[^]]*\] ]] && branch="${BASH_REMATCH[1]}"
6161
6262 # get major version prefix from the release branch ("27.x -> "27.")
63- [[ "$GITHUB_BASE_REF" =~ ^\ ([0-9]*\.\ ) ]] && target_branch="${BASH_REMATCH[1]}"
63+ [[ "$GITHUB_BASE_REF" =~ ^([0-9]*\.) ]] && target_branch="${BASH_REMATCH[1]}" || target_branch="$GITHUB_BASE_REF "
6464
65- if [[ "$GITHUB_BASE_REF " != "$branch" ]] && ! [[ "$GITHUB_BASE_REF" == "master" && "$branch" == "" ]]; then
65+ if [[ "$target_branch " != "$branch" ]] && ! [[ "$GITHUB_BASE_REF" == "master" && "$branch" == "" ]]; then
6666 echo "::error::PR is opened against the $GITHUB_BASE_REF branch, but its title suggests otherwise."
6767 exit 1
6868 fi
You can’t perform that action at this time.
0 commit comments