Skip to content

Commit 10d2586

Browse files
authored
feat: implement smart PR creation for feature tracker updates (#256)
- 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
1 parent 3764756 commit 10d2586

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/feature-discovery.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,9 @@ jobs:
606606
LOCKFILE="/tmp/feature-tracker.lock"
607607
TRACKER_FILE=".github/feature-tracker/backup-features.json"
608608
TEMP_FILE="${TRACKER_FILE}.tmp"
609+
610+
# Get issues created count from previous step
611+
ISSUES_CREATED="${{ steps.create-issues-from-json.outputs.issues_created || '0' }}"
609612
610613
# Acquire lock with timeout
611614
exec 200>"$LOCKFILE"
@@ -620,6 +623,17 @@ jobs:
620623
flock -u 200
621624
exit 0
622625
fi
626+
627+
# Only create PR if new issues were created (meaningful changes)
628+
if [ "$ISSUES_CREATED" -eq 0 ]; then
629+
echo "📊 Tracker updated with metadata only - skipping PR creation"
630+
echo "ℹ️ Scan completed but no new features discovered"
631+
echo "ℹ️ Updated metadata: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
632+
flock -u 200
633+
exit 0
634+
fi
635+
636+
echo "🚀 Creating PR for tracker updates with $ISSUES_CREATED new issues"
623637
624638
# Validate JSON before committing
625639
if [ -f "$TRACKER_FILE" ]; then
@@ -716,6 +730,18 @@ jobs:
716730
else
717731
echo "- ❌ **Issue Creation**: Failed or incomplete" >> $GITHUB_STEP_SUMMARY
718732
fi
733+
734+
# Tracker Update Status
735+
if [ "${{ steps.claude-discovery.conclusion }}" = "success" ]; then
736+
ISSUES_COUNT="${{ steps.create-issues-from-json.outputs.issues_created || '0' }}"
737+
if [ "$ISSUES_COUNT" -gt 0 ]; then
738+
echo "- ✅ **Tracker Updates**: Created PR for database updates" >> $GITHUB_STEP_SUMMARY
739+
else
740+
echo "- 📊 **Tracker Updates**: Metadata updated (no PR needed)" >> $GITHUB_STEP_SUMMARY
741+
fi
742+
else
743+
echo "- ⏭️ **Tracker Updates**: Skipped (discovery failed)" >> $GITHUB_STEP_SUMMARY
744+
fi
719745
echo "" >> $GITHUB_STEP_SUMMARY
720746
721747
# Available Commands

0 commit comments

Comments
 (0)