Troubleshooting¶
Common issues and solutions for PR Auto-Labeler.
Labels Not Applied¶
Issue: No labels appear on PR¶
Possible Causes:
-
No rules enabled
-
Missing permissions
-
Workflow not triggered
Solution: Enable debug mode to see what's happening:
Workflow Not Running¶
Issue: Action doesn't execute at all¶
Check:
- ✅ File location:
.github/workflows/pr-labeler.yml - ✅ GitHub Actions enabled in repository settings
- ✅ Valid YAML syntax (use a YAML validator)
- ✅ PR opened (not just pushed to branch)
Debug Steps:
- Go to Actions tab in repository
- Check for workflow runs
- Look for YAML syntax errors
- Verify trigger conditions
Specific Rules Not Working¶
Issue: Some rules don't trigger¶
Troubleshooting:
-
Check rule name spelling
-
Verify file patterns match
Enable debug mode to see file analysis:
- Check JSON syntax
Permission Errors¶
Issue: "Resource not accessible by integration"¶
Solution: Add required permissions:
Debug Mode¶
Enable Detailed Logging¶
What Debug Mode Shows¶
- ✅ Files analyzed
- ✅ Rules evaluated
- ✅ Pattern matches
- ✅ Labels applied
- ✅ Execution timing
Example Debug Output¶
[UI Change Rule] Analyzing 5 files
[UI Change Rule] UI file detected: src/components/Button.tsx
[UI Change Rule] Labels to apply: ui-change
[Test Missing Rule] Source changed: src/components/Button.tsx
[Test Missing Rule] No test changes detected
[Test Missing Rule] Labels to apply: test-missing
✅ Applied labels: ui-change, test-missing
Common Errors¶
Invalid JSON¶
# ❌ Wrong
enabled_rules: '["ui-change", "test-missing",]' # Trailing comma
# ✅ Correct
enabled_rules: '["ui-change", "test-missing"]'
Wrong Quotation¶
# ❌ Wrong - unescaped quotes
label_overrides: '{"ui-change": "frontend"}' # May fail in some YAML parsers
# ✅ Correct - use single quotes for JSON string
label_overrides: '{"ui-change": "frontend"}'
FAQ¶
Can I use custom label colors?
Labels are created automatically by GitHub with default colors. To customize:
- Create labels manually with desired colors
- PR Auto-Labeler will use existing labels
How do I disable a rule temporarily?
Remove it from enabled_rules:
Can I run the action locally?
The action requires GitHub context. For local testing:
- Use act to simulate GitHub Actions
- Or test directly on a test repository
Does it work with forks?
Yes, but permissions depend on repository settings. For forks:
- Same organization: Usually works
- External forks: May need approval for first-time contributors
What's the performance impact?
- Average run time: 2-5 seconds
- No impact on PR creation speed
- Runs asynchronously after PR is opened
Getting Help¶
If you're still experiencing issues:
- Check debug logs with
enable_debug: true - Search existing issues on GitHub Issues
- Ask in Discussions at GitHub Discussions
- Open a new issue with:
- Workflow configuration
- Debug logs
- PR link (if public)
- Expected vs actual behavior