Skip to content

Commit f846b3b

Browse files
committed
TT-18255 Fix failing CI
1 parent 261728d commit f846b3b

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/move_crd_values_to_operator.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@ jobs:
2727
MERGE_COMMIT=$(git --no-pager log -1 --merges --pretty=format:%H)
2828
echo "Merge commit: $MERGE_COMMIT"
2929
30-
COMMIT_MESSAGE=$(git --no-pager show -s --pretty=%B $MERGE_COMMIT)
31-
echo "Commit message: $COMMIT_MESSAGE"
30+
COMMIT_TITLE=$(git --no-pager show -s --pretty=%s "$MERGE_COMMIT")
31+
echo "Commit title: $COMMIT_TITLE"
3232
33-
SOURCE_BRANCH=$(echo "$COMMIT_MESSAGE" | grep -oE 'Merge branch .* into ' | sed -E 's/Merge branch (.*) into .*/\1/')
33+
if [[ "$COMMIT_TITLE" =~ ^Merge[[:space:]]branch[[:space:]](.+)[[:space:]]into[[:space:]].+$ ]]; then
34+
SOURCE_BRANCH="${BASH_REMATCH[1]}"
35+
elif [[ "$COMMIT_TITLE" =~ ^Merge[[:space:]]pull[[:space:]]request[[:space:]]#[0-9]+[[:space:]]from[[:space:]][^/]+/(.+)$ ]]; then
36+
SOURCE_BRANCH="${BASH_REMATCH[1]}"
37+
else
38+
SOURCE_BRANCH=""
39+
fi
3440
3541
if [[ -z "$SOURCE_BRANCH" ]]; then
3642
echo "Error: Unable to determine source branch."

0 commit comments

Comments
 (0)