GitHub Workflow Automation Skill
This skill provides comprehensive automation for GitHub issue management, pull request workflows, and WordPress-specific code validation.
Core Capabilities
1. Batch Issue Creation
Create multiple GitHub issues from structured data sources (JSON or CSV).
When to use:
- •Converting audit results to issues
- •Importing issues from spreadsheets
- •Bulk issue creation from templates
How it works:
python scripts/batch_create_issues.py --input issues.json --repo owner/repo python scripts/batch_create_issues.py --input issues.csv --format csv
See references/batch-issues-guide.md for detailed JSON/CSV schemas.
2. Automated PR Creation
Create pull requests from issues with automatic "Fixes #N" linking.
When to use:
- •Converting issues to PRs with proper linking
- •Automating PR workflow from feature branches
- •Ensuring issue closure on PR merge
How it works:
python scripts/create_pr_from_issue.py --issue 123 --base main python scripts/create_pr_from_issue.py --issue 456 --draft
See references/pr-workflow-guide.md for best practices.
3. Pre-PR Testing
Execute tests before creating pull requests to ensure code quality.
When to use:
- •Before creating any PR
- •As part of CI/CD pipeline
- •Validating WordPress code changes
How it works:
bash scripts/run_tests.sh bash scripts/run_tests.sh --verbose
Automatically detects: PHPUnit, pytest, npm test, WordPress test suite.
4. WordPress Validation
Run WordPress Coding Standards (PHPCS) checks with optional auto-fix.
When to use:
- •Before committing WordPress PHP code
- •Ensuring WPCS compliance
- •Automated code quality gates
How it works:
bash scripts/validate_wordpress.sh bash scripts/validate_wordpress.sh --fix bash scripts/validate_wordpress.sh --standard WordPress-Extra
See references/wordpress-standards.md for configuration details.
Common Workflows
Workflow 1: Convert Website Audit to Issues
- •Create CSV/JSON file with audit findings
- •Validate input:
python scripts/validate_input.py --input audit.json - •Create issues:
python scripts/batch_create_issues.py --input audit.json
Workflow 2: Issue-to-PR with Tests
- •Check GitHub health:
bash scripts/gh_health_check.sh - •Run tests:
bash scripts/run_tests.sh - •Create PR:
python scripts/create_pr_from_issue.py --issue 123
Workflow 3: WordPress Code Contribution
- •Validate code:
bash scripts/validate_wordpress.sh --fix - •Run tests:
bash scripts/run_tests.sh - •Create PR:
python scripts/create_pr_from_issue.py --issue 456
Scripts Reference
All scripts are in the scripts/ directory:
- •batch_create_issues.py - Create multiple issues from JSON/CSV
- •create_pr_from_issue.py - Create PR linked to issue(s)
- •run_tests.sh - Execute test suites with auto-detection
- •validate_wordpress.sh - Run PHPCS with WordPress standards
- •validate_input.py - Validate JSON/CSV before processing
- •gh_health_check.sh - Verify gh CLI authentication and permissions
Detailed References
For comprehensive documentation, see the references/ directory:
- •batch-issues-guide.md - JSON/CSV schemas and examples
- •wordpress-standards.md - WPCS configuration and best practices
- •github-actions-integration.md - CI/CD workflow examples
- •pr-workflow-guide.md - PR creation best practices
- •error-handling.md - Common errors and solutions
- •templates/ - Reusable issue and PR templates
Error Handling
All scripts include comprehensive error handling:
- •Input validation before execution
- •Clear error messages with suggested actions
- •Graceful handling of rate limits
- •Partial success support (continue on individual failures)
See references/error-handling.md for troubleshooting guidance.
Prerequisites
Required tools (scripts will check for these):
- •
ghCLI installed and authenticated - •Git configured
- •For WordPress validation:
phpcswith WPCS installed - •For testing: Appropriate test framework (PHPUnit, etc.)
Run health check: bash scripts/gh_health_check.sh
Examples
Create Issues from JSON
{
"issues": [
{
"title": "Fix contact form",
"body": "Contact form not submitting...",
"labels": ["bug", "priority:high"],
"assignees": ["username"]
}
]
}
python scripts/batch_create_issues.py --input issues.json
Create PR with Multiple Issue Links
python scripts/create_pr_from_issue.py --issue 123,124,125 --base main
Validate and Auto-Fix WordPress Code
bash scripts/validate_wordpress.sh --fix --standard WordPress-Extra
Integration Points
This skill integrates with:
- •GitHub CLI - All GitHub operations
- •GitHub Actions - See
references/github-actions-integration.md - •WordPress Coding Standards - Code quality enforcement
- •Test Frameworks - Automated testing before PRs
Best Practices
- •Always validate input before batch operations
- •Run tests before creating PRs
- •Use dry-run mode to preview changes
- •Check health before starting workflows
- •Follow WordPress standards for all PHP code
- •Link PRs to issues using "Fixes #N" syntax
- •Review automated PRs even when tests pass
Troubleshooting
Scripts not executable?
chmod +x scripts/*.sh
gh CLI not authenticated?
gh auth login
PHPCS not found?
composer global require wp-coding-standards/wpcs phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-standards/wpcs
For more help, see references/error-handling.md.