chore(github): fix release notes (#9457)

This commit is contained in:
César Arroba
2025-12-04 12:15:09 +01:00
committed by GitHub
parent 4a5801c519
commit 9c387d5742

View File

@@ -154,12 +154,6 @@ jobs:
return
fi
echo "DEBUG: Extracting from $file for version $version"
echo "DEBUG: Looking for pattern: ^## \[v?${version}\]"
# Show what we're trying to match
grep "^## \[" "$file" | head -3
# Extract changelog section for this version
awk -v version="$version" '
/^## \[v?'"$version"'\]/ { found=1; next }
@@ -167,59 +161,55 @@ jobs:
found && !/^## \[v?'"$version"'\]/ { print }
' "$file" > "$output_file"
echo "DEBUG: Extracted $(wc -l < "$output_file") lines, $(wc -c < "$output_file") bytes"
# Remove --- separators
sed -i '/^---$/d' "$output_file"
echo "DEBUG: After sed: $(wc -l < "$output_file") lines, $(wc -c < "$output_file") bytes"
echo "DEBUG: First 3 lines of output:"
head -3 "$output_file" || echo "(empty)"
}
# Determine if components have changes for this specific release
# A component has changes if we found a version for it in the changelog
# SDK has changes if we found a version
if [ -n "$SDK_VERSION" ]; then
echo "HAS_SDK_CHANGES=true" >> $GITHUB_ENV
HAS_SDK_CHANGES="true"
echo "✓ SDK changes detected - version: $SDK_VERSION"
extract_changelog "prowler/CHANGELOG.md" "$SDK_VERSION" "prowler_changelog.md"
else
echo "HAS_SDK_CHANGES=false" >> $GITHUB_ENV
HAS_SDK_CHANGES="false"
echo " No SDK changes for this release"
touch "prowler_changelog.md"
fi
# API has changes if we found a version
if [ -n "$API_VERSION" ]; then
echo "HAS_API_CHANGES=true" >> $GITHUB_ENV
HAS_API_CHANGES="true"
echo "✓ API changes detected - version: $API_VERSION"
extract_changelog "api/CHANGELOG.md" "$API_VERSION" "api_changelog.md"
else
echo "HAS_API_CHANGES=false" >> $GITHUB_ENV
HAS_API_CHANGES="false"
echo " No API changes for this release"
touch "api_changelog.md"
fi
# UI has changes if we found a version
if [ -n "$UI_VERSION" ]; then
echo "HAS_UI_CHANGES=true" >> $GITHUB_ENV
HAS_UI_CHANGES="true"
echo "✓ UI changes detected - version: $UI_VERSION"
extract_changelog "ui/CHANGELOG.md" "$UI_VERSION" "ui_changelog.md"
else
echo "HAS_UI_CHANGES=false" >> $GITHUB_ENV
HAS_UI_CHANGES="false"
echo " No UI changes for this release"
touch "ui_changelog.md"
fi
# MCP has changes if we found a version
if [ -n "$MCP_VERSION" ]; then
echo "HAS_MCP_CHANGES=true" >> $GITHUB_ENV
HAS_MCP_CHANGES="true"
echo "✓ MCP changes detected - version: $MCP_VERSION"
extract_changelog "mcp_server/CHANGELOG.md" "$MCP_VERSION" "mcp_changelog.md"
else
echo "HAS_MCP_CHANGES=false" >> $GITHUB_ENV
HAS_MCP_CHANGES="false"
echo " No MCP changes for this release"
touch "mcp_changelog.md"
fi