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
10 changes: 10 additions & 0 deletions .github/workflows/generate-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ jobs:
}

if ! RELEASES=$(gh api "repos/${OWNER}/${REPO}/releases?per_page=50" 2>&1); then
if echo "$RELEASES" | grep -q '"status":"404"'; then
echo "::warning::Repository ${OWNER}/${REPO} not found or releases not accessible (404), skipping"
echo "::endgroup::"
exit 0
fi
echo "::error::Failed to fetch releases for ${OWNER}/${REPO}: ${RELEASES}"
exit 1
fi
Expand All @@ -290,6 +295,11 @@ jobs:
if [ "$(echo "$RELEASES" | jq 'length')" -eq 0 ]; then
echo "No releases found, trying tags..."
if ! TAGS_JSON=$(gh api "repos/${OWNER}/${REPO}/tags?per_page=20" 2>&1); then
if echo "$TAGS_JSON" | grep -q '"status":"404"'; then
echo "::warning::Repository ${OWNER}/${REPO} not found or tags not accessible (404), skipping"
echo "::endgroup::"
exit 0
fi
echo "::error::Failed to fetch tags for ${OWNER}/${REPO}: ${TAGS_JSON}"
exit 1
fi
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/reusable-generate-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ jobs:
}

if ! RELEASES=$(gh api "repos/${OWNER}/${REPO}/releases?per_page=50" 2>&1); then
if echo "$RELEASES" | grep -q '"status":"404"'; then
echo "::warning::Repository ${OWNER}/${REPO} not found or releases not accessible (404), skipping"
echo "::endgroup::"
exit 0
fi
echo "::error::Failed to fetch releases for ${OWNER}/${REPO}: ${RELEASES}"
exit 1
fi
Expand All @@ -146,6 +151,11 @@ jobs:

if [ "$(echo "$RELEASES" | jq 'length')" -eq 0 ]; then
if ! TAGS_JSON=$(gh api "repos/${OWNER}/${REPO}/tags?per_page=20" 2>&1); then
if echo "$TAGS_JSON" | grep -q '"status":"404"'; then
echo "::warning::Repository ${OWNER}/${REPO} not found or tags not accessible (404), skipping"
echo "::endgroup::"
exit 0
fi
echo "::error::Failed to fetch tags for ${OWNER}/${REPO}: ${TAGS_JSON}"
exit 1
fi
Expand Down
Loading