Browse Source

fix(action): update variant matrix handling for improved flexibility in workflows

Co-authored-by: Copilot <copilot@github.com>
TheWildJames 4 months ago
parent
commit
258c448951
2 changed files with 1 additions and 11 deletions
  1. 1 1
      .github/workflows/build.yml
  2. 0 10
      .github/workflows/prepare.yml

+ 1 - 1
.github/workflows/build.yml

@@ -34,7 +34,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        variant: ["${{ inputs.variant }}"]
+        variant: ${{ inputs.variant == 'All' && fromJson('["Normal","Bypass","Wild"]') || fromJson('["' ~ inputs.variant ~ '"]') }}
     runs-on: ubuntu-latest
     timeout-minutes: 60
 

+ 0 - 10
.github/workflows/prepare.yml

@@ -62,16 +62,6 @@ jobs:
             MATRIX_JSON=$(echo "$MATRIX_JSON" | tr -d '\n' | tr -d ' ')
           fi
           
-          echo "Matrix content: $MATRIX_JSON"
-
-          # Filter the matrix by variant input if not ALL
-          if [ "${{ inputs.variant }}" != "" ] && [ "${{ inputs.variant }}" != "ALL" ]; then
-            if command -v jq &> /dev/null; then
-              MATRIX_JSON=$(echo "$MATRIX_JSON" | jq -c --arg v "${{ inputs.variant }}" '[.[] | select(.variant == $v)]')
-            else
-              echo "Warning: jq not found, cannot filter variants."
-            fi
-          fi
           echo "Matrix content: $MATRIX_JSON"
           echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT