From d3ecafdf8a124c8b722b34e41097bf08fe5b8036 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Mon, 28 Oct 2024 17:09:48 -0600 Subject: [PATCH] feat: allow alternate paths for the check flavor zarf.yaml (#326) --- .github/actions/test-flavor/action.yaml | 7 ++++++- templates/test.yml | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-flavor/action.yaml b/.github/actions/test-flavor/action.yaml index 4d53ff40..2d4f421a 100644 --- a/.github/actions/test-flavor/action.yaml +++ b/.github/actions/test-flavor/action.yaml @@ -9,6 +9,11 @@ outputs: value: ${{ steps.set-required.outputs.upgrade-flavors }} description: Indicates if the upgrade should be skipped +inputs: + check-flavor-zarf-yaml: + default: zarf.yaml + description: Relative path of a zarf.yaml containing flavors to check + runs: using: composite steps: @@ -35,5 +40,5 @@ runs: git checkout "$TAG" # Extract upgrade flavors and set output - echo "upgrade-flavors=$(cat zarf.yaml | yq '.components[] | select(.only | has("flavor")) | .only.flavor' | paste -s -d, - || echo '')" >> "$GITHUB_OUTPUT" + echo "upgrade-flavors=$(cat ${{ inputs.check-flavor-zarf-yaml }} | yq '.components[] | select(.only | has("flavor")) | .only.flavor' | paste -s -d, - || echo '')" >> "$GITHUB_OUTPUT" shell: bash diff --git a/templates/test.yml b/templates/test.yml index 8742a68c..cf87df44 100644 --- a/templates/test.yml +++ b/templates/test.yml @@ -16,6 +16,8 @@ spec: default: ${IRON_BANK_ROBOT_PASSWORD} chainguard-identity: default: ${CHAINGUARD_IDENTITY} + check-flavor-zarf-yaml: + default: zarf.yaml --- test: id_tokens: @@ -38,7 +40,7 @@ test: git checkout "$TAG" # Extract upgrade flavors and set UPGRADE_FLAVORS - UPGRADE_FLAVORS=$(cat zarf.yaml | yq '.components[] | select(.only | has("flavor")) | .only.flavor' | paste -s -d, - || echo "") + UPGRADE_FLAVORS=$(cat $[[ inputs.check-flavor-zarf-yaml ]] | yq '.components[] | select(.only | has("flavor")) | .only.flavor' | paste -s -d, - || echo "") # change back to the commit branch for the rest of the job git checkout -