Files
Krow-workspace/.github/scripts/extract-release-notes.sh
Achintha Isuru 39f0d9d53c refactor(ci): update product options to be more specific
🔄 Changed product option values:
- worker → worker-mobile-app
- client → client-mobile-app

📝 Updated Files:
- .github/workflows/hotfix-branch-creation.yml
- .github/workflows/product-release.yml
- .github/scripts/extract-version.sh
- .github/scripts/extract-release-notes.sh
- .github/scripts/create-release-summary.sh
- .github/scripts/generate-tag-name.sh

🎯 Key Changes:
- Product dropdown options now more specific
- All conditional checks updated to use new values
- Tag/branch names remain clean (strips -mobile-app suffix)
- Tag format unchanged: krow-withus-worker-mobile/prod-v0.1.0
- Branch format unchanged: hotfix/krow-withus-worker-mobile-v0.1.0

Benefits:
 Clearer product selection (distinguishes mobile from future web/backend)
 Backward compatible tag format
 Maintains clean naming conventions
2026-03-05 12:11:45 -05:00

66 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Extract release notes from CHANGELOG for a specific version
# Usage: ./extract-release-notes.sh <app> <version> <environment> <tag_name> <output_file>
set -e
APP=$1
VERSION=$2
ENV=$3
TAG_NAME=$4
OUTPUT_FILE=$5
if [ -z "$APP" ] || [ -z "$VERSION" ] || [ -z "$ENV" ] || [ -z "$TAG_NAME" ] || [ -z "$OUTPUT_FILE" ]; then
echo "❌ Error: Missing required parameters"
echo "Usage: ./extract-release-notes.sh <app> <version> <environment> <tag_name> <output_file>"
exit 1
fi
# Determine CHANGELOG path and app name
if [ "$APP" = "worker-mobile-app" ]; then
CHANGELOG_PATH="apps/mobile/apps/staff/CHANGELOG.md"
APP_NAME="Staff Product (Worker)"
else
CHANGELOG_PATH="apps/mobile/apps/client/CHANGELOG.md"
APP_NAME="Client Product"
fi
# Try to extract release notes for this version
if [ -f "$CHANGELOG_PATH" ]; then
echo "📝 Found CHANGELOG at $CHANGELOG_PATH"
# Extract section for this version
# Look for ## [VERSION] and collect until next ## [ or end of file
NOTES=$(awk "/## \[${VERSION}\]/,/^## \[/" "$CHANGELOG_PATH" | sed '1d;$d' | sed '/^$/d')
if [ -z "$NOTES" ]; then
echo "⚠️ Warning: No CHANGELOG entry found for version $VERSION"
NOTES="Release $VERSION for $APP_NAME
⚠️ No CHANGELOG entry found for this version. Please update the CHANGELOG manually.
**Environment:** $ENV
**Tag:** $TAG_NAME"
else
echo "✅ Extracted release notes for version $VERSION"
NOTES="# $APP_NAME - Release $VERSION
$NOTES
---
**Environment:** $ENV
**Tag:** $TAG_NAME"
fi
else
echo "⚠️ Warning: CHANGELOG not found at $CHANGELOG_PATH"
NOTES="Release $VERSION for $APP_NAME
**Environment:** $ENV
**Tag:** $TAG_NAME"
fi
# Save to output file
echo "$NOTES" > "$OUTPUT_FILE"
echo "✅ Release notes saved to $OUTPUT_FILE"