From dbc22557b783937b1317f84ac4b78743599da39b Mon Sep 17 00:00:00 2001 From: "Luis M. Gallardo D" Date: Tue, 2 Sep 2025 04:42:10 +0200 Subject: [PATCH] feat: implement smart PR creation for feature tracker updates - Only create PRs when new issues are discovered (meaningful changes) - Skip PR creation for metadata-only updates (scan dates, counts) - Add informative logging when PR creation is skipped - Update workflow summary to show tracker update status - Reduces PR noise while maintaining functionality --- .github/workflows/feature-discovery.yml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/feature-discovery.yml b/.github/workflows/feature-discovery.yml index ecef70f..5854e7e 100644 --- a/.github/workflows/feature-discovery.yml +++ b/.github/workflows/feature-discovery.yml @@ -606,6 +606,9 @@ jobs: LOCKFILE="/tmp/feature-tracker.lock" TRACKER_FILE=".github/feature-tracker/backup-features.json" TEMP_FILE="${TRACKER_FILE}.tmp" + + # Get issues created count from previous step + ISSUES_CREATED="${{ steps.create-issues-from-json.outputs.issues_created || '0' }}" # Acquire lock with timeout exec 200>"$LOCKFILE" @@ -620,6 +623,17 @@ jobs: flock -u 200 exit 0 fi + + # Only create PR if new issues were created (meaningful changes) + if [ "$ISSUES_CREATED" -eq 0 ]; then + echo "📊 Tracker updated with metadata only - skipping PR creation" + echo "â„šī¸ Scan completed but no new features discovered" + echo "â„šī¸ Updated metadata: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" + flock -u 200 + exit 0 + fi + + echo "🚀 Creating PR for tracker updates with $ISSUES_CREATED new issues" # Validate JSON before committing if [ -f "$TRACKER_FILE" ]; then @@ -716,6 +730,18 @@ jobs: else echo "- ❌ **Issue Creation**: Failed or incomplete" >> $GITHUB_STEP_SUMMARY fi + + # Tracker Update Status + if [ "${{ steps.claude-discovery.conclusion }}" = "success" ]; then + ISSUES_COUNT="${{ steps.create-issues-from-json.outputs.issues_created || '0' }}" + if [ "$ISSUES_COUNT" -gt 0 ]; then + echo "- ✅ **Tracker Updates**: Created PR for database updates" >> $GITHUB_STEP_SUMMARY + else + echo "- 📊 **Tracker Updates**: Metadata updated (no PR needed)" >> $GITHUB_STEP_SUMMARY + fi + else + echo "- â­ī¸ **Tracker Updates**: Skipped (discovery failed)" >> $GITHUB_STEP_SUMMARY + fi echo "" >> $GITHUB_STEP_SUMMARY # Available Commands