Automated Draft PR creation based on Git change analysis
Automate Pull Request creation through Git change analysis for an efficient PR workflow.
$ARGUMENTS contains --ja: Write PR title and description in Japanese# Verify current branch (must not be develop/main)
git branch --show-current
# Check for uncommitted changes
git status
# Follow naming convention: {type}/{subject}
git switch develop && git pull
git switch -c feat/feature-name
# List commits
git log --oneline develop..HEAD
# Review changes
git diff develop...HEAD --stat
git diff develop...HEAD
.github/PULL_REQUEST_TEMPLATE.md exists<!-- ... -->) as-is# Create Draft PR using GitHub CLI
# Pass --body via HEREDOC to preserve HTML comments
gh pr create --draft --base develop --title "Title" --body "$(cat <<'EOF'
PR body
EOF
)"
gh pr ready after CI passes<!-- ... --> intact--- and other structural elements{type}/{subject}
Types:
- feat/ ... New feature
- fix/ ... Bug fix
- refactor/ ... Refactoring (no functionality change)
- chore/ ... Build, CI, dependencies, maintenance
Examples:
- feat/user-profile
- fix/login-error
- refactor/api-client
- chore/update-dependencies
How to determine the prefix:
release/, prefer fix/{type}: {description}
Examples:
- feat: implement user authentication API
- fix: resolve login error
- docs: update README
.github/PULL_REQUEST_TEMPLATE.md if it existsGitHub CLI (gh pr edit) may auto-escape HTML comments. Countermeasures:
--body content