@@ -343,13 +343,27 @@ jobs:
343343 BASE_BRANCH="${{ github.base_ref }}"
344344 echo "Using PR base branch: $BASE_BRANCH"
345345 else
346- # Extract base branch from branch name pattern: {name}_base or {name}-base
347- # Match patterns like {shreeya}_ciqlts9_2 or {shreeya}-ciqlts9_2
348- if [[ "$BRANCH_NAME" =~ \{[^}]+\}[_-](.+) ]]; then
346+ # Extract base branch from branch name.
347+ # Two supported patterns (both require curly-brace {USER} prefix):
348+ #
349+ # 1. RLC pattern : {user}_rlc-N/VERSION
350+ # e.g. {shreeya}_rlc-10/6.12.0-124.2.1.el10_1
351+ # Base branch : rlc-N/VERSION (everything after the first '_')
352+ # No whitelist validation — the version string is the base.
353+ #
354+ # 2. Legacy pattern: {user}_BASE or {user}-BASE
355+ # e.g. {shreeya}_ciqlts9_2
356+ # Base branch : BASE (must be in VALID_BASES whitelist)
357+
358+ if [[ "$BRANCH_NAME" =~ ^\{[^}]+\}_(rlc-[0-9]+/.+)$ ]]; then
359+ # RLC pattern: base is rlc-N/VERSION
360+ BASE_BRANCH="${BASH_REMATCH[1]}"
361+ echo "Detected RLC branch pattern, base branch: $BASE_BRANCH"
362+ elif [[ "$BRANCH_NAME" =~ \{[^}]+\}[_-](.+) ]]; then
363+ # Legacy pattern: validate against whitelist
349364 EXTRACTED_BASE="${BASH_REMATCH[1]}"
350365 echo "Extracted base branch from branch name: $EXTRACTED_BASE"
351366
352- # Validate against whitelist
353367 if echo "$VALID_BASES" | grep -wq "$EXTRACTED_BASE"; then
354368 BASE_BRANCH="$EXTRACTED_BASE"
355369 echo "Base branch validated: $BASE_BRANCH"
@@ -359,8 +373,9 @@ jobs:
359373 exit 1
360374 fi
361375 else
362- echo "::error::Branch name does not match expected pattern {name}_base or {name}-base"
363- echo "::error::Branch name must be in format {name}_base or {name}-base where base is one of: $VALID_BASES"
376+ echo "::error::Branch name does not match any known pattern"
377+ echo "::error:: Legacy pattern : {user}_BASE or {user}-BASE (BASE must be one of: $VALID_BASES)"
378+ echo "::error:: RLC pattern : {user}_rlc-N/VERSION (e.g. {user}_rlc-10/6.12.0-124.2.1.el10_1)"
364379 exit 1
365380 fi
366381 fi
@@ -409,9 +424,11 @@ jobs:
409424 continue
410425 fi
411426
412- # Extract base from branch name pattern {name}_base or {name}-base
427+ # Extract base from branch name — support both legacy and RLC patterns
413428 EXTRACTED_BASE=""
414- if [[ "$HEAD_BRANCH" =~ \{[^}]+\}[_-](.+) ]]; then
429+ if [[ "$HEAD_BRANCH" =~ ^\{[^}]+\}_(rlc-[0-9]+/.+)$ ]]; then
430+ EXTRACTED_BASE="${BASH_REMATCH[1]}"
431+ elif [[ "$HEAD_BRANCH" =~ \{[^}]+\}[_-](.+) ]]; then
415432 EXTRACTED_BASE="${BASH_REMATCH[1]}"
416433 fi
417434
@@ -539,9 +556,11 @@ jobs:
539556 if : success() || failure()
540557
541558 steps :
542- - name : Check if branch name contains curly brackets
559+ - name : Check if branch name matches a supported pattern
543560 run : |
544561 BRANCH_NAME="${{ github.ref_name }}"
562+ # Accept any branch whose name contains curly braces (covers both
563+ # legacy {user}_BASE and RLC {user}_rlc-N/VERSION patterns)
545564 if [[ ! "$BRANCH_NAME" =~ \{ ]] || [[ ! "$BRANCH_NAME" =~ \} ]]; then
546565 echo "Branch name '$BRANCH_NAME' does not contain curly brackets, skipping PR creation"
547566 exit 1
0 commit comments