Skip to content

Commit 0137efc

Browse files
committed
Handle merge-multipledirectory structure.
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent ffe8c89 commit 0137efc

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/trivy_images.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,15 @@ jobs:
9494
merge-multiple: true
9595
- id: combine-sarifs
9696
run: |
97-
# Combine all SARIF files from all artifacts into a single matrix
97+
# With merge-multiple: true, all artifacts are in the same directory
98+
# Find all SARIF files regardless of subdirectory structure
9899
all_files=()
99-
for artifact in cloud operator vizier; do
100-
if [ -d "sarif/$artifact" ]; then
101-
for f in sarif/$artifact/*.sarif; do
102-
if [ -f "$f" ]; then
103-
all_files+=("$f")
104-
fi
105-
done
106-
fi
107-
done
100+
while IFS= read -r -d '' file; do
101+
echo "Found file: $file"
102+
all_files+=("$file")
103+
done < <(find . -name "*.sarif" -type f -print0)
104+
105+
echo "Total files found: ${#all_files[@]}"
108106
109107
if [ ${#all_files[@]} -eq 0 ]; then
110108
echo "matrix={\"include\":[]}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)