Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,23 @@ jobs:
run: |
cd test-sbom
if [ "${{ matrix.format }}" = "json" ]; then
ls -lh *.cdx.json 2>/dev/null || ls -lh test-sbom_*.cdx.json || { echo "No JSON SBOM found"; exit 1; }
if compgen -G "*.cdx.json" > /dev/null 2>&1; then
ls -lh *.cdx.json
elif compgen -G "test-sbom_*.cdx.json" > /dev/null 2>&1; then
ls -lh test-sbom_*.cdx.json
else
echo "No JSON SBOM found"
exit 1
fi
else
ls -lh *.cdx.xml 2>/dev/null || ls -lh test-sbom_*.cdx.xml || { echo "No XML SBOM found"; exit 1; }
if compgen -G "*.cdx.xml" > /dev/null 2>&1; then
ls -lh *.cdx.xml
elif compgen -G "test-sbom_*.cdx.xml" > /dev/null 2>&1; then
ls -lh test-sbom_*.cdx.xml
else
echo "No XML SBOM found"
exit 1
fi
fi

test-generate-sbom-workspace:
Expand Down Expand Up @@ -788,7 +802,12 @@ jobs:
echo "Searching for SBOMs in workspace..."

# Check root
ls -lh *.cdx.json 2>/dev/null || true
if compgen -G "*.cdx.json" > /dev/null 2>&1; then
echo "Root SBOMs:"
for file in *.cdx.json; do
ls -lh "$file"
done
fi

# Check each crate
find . -name "*.cdx.json" -not -path "*/target/*" -type f | while read sbom; do
Expand Down
18 changes: 13 additions & 5 deletions rust/generate-sbom/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ runs:
echo "Generated SBOM files:"

# Check root directory
if ls *.cdx.* 2>/dev/null; then
if compgen -G "*.cdx.*" > /dev/null 2>&1; then
echo "Root directory SBOMs:"
ls -lh *.cdx.*
for file in *.cdx.*; do
ls -lh "$file"
done
fi

# Check each crate directory (for workspace with describe=crate)
Expand All @@ -121,7 +123,9 @@ runs:
if compgen -G "$crate_dir/*.cdx.*" > /dev/null 2>&1; then
echo ""
echo "SBOMs in $crate_dir:"
ls -lh "$crate_dir"/*.cdx.*
for file in "$crate_dir"/*.cdx.*; do
ls -lh "$file"
done
fi
done
fi
Expand All @@ -131,12 +135,16 @@ runs:
echo ""
echo "Searching for SBOMs in target directories..."
find target -name "*.cdx.*" -type f 2>/dev/null | while read sbom_file; do
echo " $(ls -lh "$sbom_file")"
ls -lh "$sbom_file"
done
fi

# Summary count
echo ""
total_sboms=$(find . -name "*.cdx.*" -not -path "*/target/*" -not -path "*/.git/*" -type f 2>/dev/null | wc -l | tr -d ' ')
target_sboms=$(find target -name "*.cdx.*" -type f 2>/dev/null | wc -l | tr -d ' ')
if [ -d "target" ]; then
target_sboms=$(find target -name "*.cdx.*" -type f 2>/dev/null | wc -l | tr -d ' ')
else
target_sboms=0
fi
echo "Total SBOMs found: $total_sboms in workspace, $target_sboms in target/"
Loading