I've reverted the changes to keep the original logic (only update blank PRs) and added extensive debugging. Here's what to check:
- Detailed PR description checking - Shows exactly what GitHub returns as the current description
- AI model response parsing - Shows if PR description was generated and extracted from AI response
- API call debugging - Shows when GitHub API calls are made
-
Enable debug mode in your workflow:
with: debug: "true"
-
Look for these log messages in the GitHub Actions output:
🔍 PR Description Update Check: {"updatePrDescriptionEnabled":true,"prDescriptionGenerated":true,"prDescriptionLength":250}🔍 PR #123 current description: "" 🔍 Current description type: string 🔍 Current description === null: false 🔍 Current description === "": true 🔍 Should update (is blank): true🔍 PR Description parsing: {"foundMatch":true,"rawMatch":"## Fix user authentication bug...","normalizedLength":245}🔄 Making GitHub API request to update PR description... ✅ Updated PR #123 description successfully
-
AI Model not generating descriptions:
- Look for
⚠️ No PR description was generated by the AI model - Check if your AI model/provider supports the current prompt format
- Look for
-
GitHub API permission issues:
- Look for
❌ Failed to update PR #123 description: - Ensure your
GITHUB_TOKENhaspull_requests: writepermission
- Look for
-
PR description not actually blank:
- Check the logged current description value
- GitHub might be returning whitespace or hidden characters
-
Configuration issues:
- Verify
update_pr_description: "true"in your workflow - Check if the feature is disabled:
⏭️ PR description update is disabled in config
- Verify
Create a new PR with a completely empty description and watch the logs. You should see:
- PR description generation in the diff summary
- Attempt to update the PR description
- Either success or detailed error message
The enhanced debugging will show you exactly where the process is failing.