Skip to content

Commit

Permalink
chore: fix no output
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-chris committed Dec 28, 2023
1 parent 16a2784 commit 5e67578
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/actions/test_matrix/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ runs:
- name: Set Matrix Outputs
id: set-matrix
run: |
components=()
paths=()
docker_files=()
working_dirs=()
image_names=()
if [ "$GITHUB_BASE_REF" ]; then
# Pull Request
git fetch origin $GITHUB_BASE_REF --depth=1
Expand All @@ -39,6 +33,12 @@ runs:
echo "Diff between ${{ github.event.before }} and $GITHUB_SHA"
fi
components=()
paths=()
docker_files=()
working_dirs=()
image_names=()
# Function to add a component
add_component() {
components+=("$1")
Expand All @@ -49,15 +49,15 @@ runs:
}
# Check if paths of each component are in the changed files
if echo "$files" | grep -qE '^backend/'; then
if echo "$DIFF" | grep -qE '^backend/'; then
add_component "Backend" "backend/models/** backend/ops_api/** backend/Dockerfile.ops-api" "Dockerfile.ops-api" "backend" "ops-backend"
fi
if echo "$files" | grep -qE '^backend/data-tools/'; then
if echo "$DIFF" | grep -qE '^backend/data-tools/'; then
add_component "Data-Tools" "backend/data-tools/** backend/Dockerfile.data-tools" "Dockerfile.data-tools" "backend" "ops-data-tools"
fi
if echo "$files" | grep -qE '^frontend/'; then
if echo "$DIFF" | grep -qE '^frontend/'; then
add_component "Frontend" "frontend/** frontend/Dockerfile.azure" "Dockerfile.azure" "frontend" "ops-frontend"
fi
Expand All @@ -67,4 +67,5 @@ runs:
echo "::set-output name=docker_file::[${docker_files[@]}]"
echo "::set-output name=working_dir::[${working_dirs[@]}]"
echo "::set-output name=image_name::[${image_names[@]}]"
shell: bash

0 comments on commit 5e67578

Please sign in to comment.