Skip to content

Commit

Permalink
feat: allow alternate paths for the check flavor zarf.yaml (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 authored Oct 28, 2024
1 parent 5a59ac8 commit d3ecafd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/actions/test-flavor/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
4 changes: 3 additions & 1 deletion templates/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 -
Expand Down

0 comments on commit d3ecafd

Please # to comment.