Loading...
Loading...
Audits and improves the pull request workflow for a GitHub repository. Covers PR description templates, auto-labelling, CODEOWNERS, PR size checks, and branch protection rules. Invoked when the user asks to improve the PR process, set up PR automation, or add a PR template.
npx skill4agent add soulcodex/agentic pull-request-automation.github/pull_request_template.md.github/CODEOWNERSmain.github/pull_request_template.md## Summary
<!-- What does this PR do? Why? -->
## Changes
<!-- Bullet list of key changes -->
## Test Plan
- [ ] Unit tests added / updated
- [ ] Manual testing performed: <describe steps>
- [ ] Breaking changes documented
## Related Issues
Closes #actions/labeler# .github/labeler.yml
frontend:
- changed-files:
- any-glob-to-any-file: "src/features/**"
backend:
- changed-files:
- any-glob-to-any-file: "internal/**"
docs:
- changed-files:
- any-glob-to-any-file: "docs/**"
infrastructure:
- changed-files:
- any-glob-to-any-file: "deployments/**"# .github/workflows/labeler.yml
name: Label PR
on: [pull_request_target]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}.github/CODEOWNERS# Global fallback
* @org/platform-team
# Frontend
/src/features/ @org/frontend-team
# Infrastructure
/deployments/ @org/infra-team
/build/ @org/infra-team
# Database migrations
/internal/infrastructure/migrations/ @org/dba-team# .github/workflows/pr-size.yml
name: PR Size Check
on: [pull_request]
jobs:
size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Check PR size
run: |
LINES=$(git diff --stat origin/${{ github.base_ref }}...HEAD | tail -1 | grep -oE '[0-9]+ insertions' | grep -oE '[0-9]+' || echo 0)
if [ "$LINES" -gt 500 ]; then
echo "::warning::PR adds $LINES lines. Consider splitting into smaller PRs."
figh apimaingh api repos/{owner}/{repo}/branches/main/protection \
--method PUT --input - <<'EOF'
{
"required_status_checks": {"strict": true, "contexts": ["ci"]},
"enforce_admins": false,
"required_pull_request_reviews": {
"required_approving_review_count": 1,
"dismiss_stale_reviews": true
},
"restrictions": null,
"allow_force_pushes": false,
"allow_deletions": false
}
EOF.github/pull_request_template.mdmain