Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc committed Jul 11, 2023
1 parent 159d6f0 commit 3077753
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/sc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -x
read -r -a changes <<< "${{ steps.change-list.outputs.all_changed_files }}"
base="${{ inputs.base }}"
images=(${{ inputs.images }})
build_base=0
build_images=()
if [[ "$base" != "" ]]; then
for c in "${changes[@]}"; do
if [[ "$c" == "$base" ]]; then
build_base=1
break
fi
done
fi
for img in "${images[@]}"; do
if [[ "$build_base" = 1 ]]; then
build_images+=("$(dirname "$img")")
continue
fi
for c in "${changes[@]}"; do
if [[ "$c" == "$img" ]]; then
build_images+=("$(dirname "$img")")
break
fi
done
done
if [[ -n "${build_images[*]}" ]]; then
build_base=1
fi
echo "matrix=$(jq -c -n --arg inarr "${build_images[*]}" '{ image: $inarr | split(" ") }')" >> $GITHUB_OUTPUT
echo "build-base=$build_base" >> $GITHUB_OUTPUT

0 comments on commit 3077753

Please sign in to comment.