From c6fd822e96bace8faa05d3ce3cdf12e04cb09522 Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Fri, 20 Feb 2026 16:58:39 +0100 Subject: [PATCH] github actions: Add kernelCI for rlc kernels Similar to lts kernels, this adds supports for user branches on top of rlc (8, 9, 10) versions. Signed-off-by: Roxana Nicolescu --- .../kernel-build-and-test-multiarch.yml | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/kernel-build-and-test-multiarch.yml b/.github/workflows/kernel-build-and-test-multiarch.yml index f90403145f567..a146df848bda4 100644 --- a/.github/workflows/kernel-build-and-test-multiarch.yml +++ b/.github/workflows/kernel-build-and-test-multiarch.yml @@ -343,13 +343,27 @@ jobs: BASE_BRANCH="${{ github.base_ref }}" echo "Using PR base branch: $BASE_BRANCH" else - # Extract base branch from branch name pattern: {name}_base or {name}-base - # Match patterns like {shreeya}_ciqlts9_2 or {shreeya}-ciqlts9_2 - if [[ "$BRANCH_NAME" =~ \{[^}]+\}[_-](.+) ]]; then + # Extract base branch from branch name. + # Two supported patterns (both require curly-brace {USER} prefix): + # + # 1. RLC pattern : {user}_rlc-N/VERSION + # e.g. {shreeya}_rlc-10/6.12.0-124.2.1.el10_1 + # Base branch : rlc-N/VERSION (everything after the first '_') + # No whitelist validation — the version string is the base. + # + # 2. Legacy pattern: {user}_BASE or {user}-BASE + # e.g. {shreeya}_ciqlts9_2 + # Base branch : BASE (must be in VALID_BASES whitelist) + + if [[ "$BRANCH_NAME" =~ ^\{[^}]+\}_(rlc-[0-9]+/.+)$ ]]; then + # RLC pattern: base is rlc-N/VERSION + BASE_BRANCH="${BASH_REMATCH[1]}" + echo "Detected RLC branch pattern, base branch: $BASE_BRANCH" + elif [[ "$BRANCH_NAME" =~ \{[^}]+\}[_-](.+) ]]; then + # Legacy pattern: validate against whitelist EXTRACTED_BASE="${BASH_REMATCH[1]}" echo "Extracted base branch from branch name: $EXTRACTED_BASE" - # Validate against whitelist if echo "$VALID_BASES" | grep -wq "$EXTRACTED_BASE"; then BASE_BRANCH="$EXTRACTED_BASE" echo "Base branch validated: $BASE_BRANCH" @@ -359,8 +373,9 @@ jobs: exit 1 fi else - echo "::error::Branch name does not match expected pattern {name}_base or {name}-base" - echo "::error::Branch name must be in format {name}_base or {name}-base where base is one of: $VALID_BASES" + echo "::error::Branch name does not match any known pattern" + echo "::error:: Legacy pattern : {user}_BASE or {user}-BASE (BASE must be one of: $VALID_BASES)" + echo "::error:: RLC pattern : {user}_rlc-N/VERSION (e.g. {user}_rlc-10/6.12.0-124.2.1.el10_1)" exit 1 fi fi @@ -409,9 +424,11 @@ jobs: continue fi - # Extract base from branch name pattern {name}_base or {name}-base + # Extract base from branch name — support both legacy and RLC patterns EXTRACTED_BASE="" - if [[ "$HEAD_BRANCH" =~ \{[^}]+\}[_-](.+) ]]; then + if [[ "$HEAD_BRANCH" =~ ^\{[^}]+\}_(rlc-[0-9]+/.+)$ ]]; then + EXTRACTED_BASE="${BASH_REMATCH[1]}" + elif [[ "$HEAD_BRANCH" =~ \{[^}]+\}[_-](.+) ]]; then EXTRACTED_BASE="${BASH_REMATCH[1]}" fi @@ -539,9 +556,11 @@ jobs: if: success() || failure() steps: - - name: Check if branch name contains curly brackets + - name: Check if branch name matches a supported pattern run: | BRANCH_NAME="${{ github.ref_name }}" + # Accept any branch whose name contains curly braces (covers both + # legacy {user}_BASE and RLC {user}_rlc-N/VERSION patterns) if [[ ! "$BRANCH_NAME" =~ \{ ]] || [[ ! "$BRANCH_NAME" =~ \} ]]; then echo "Branch name '$BRANCH_NAME' does not contain curly brackets, skipping PR creation" exit 1