A script to automate the creation of pull requests from the terminal using Zsh and GitHub CLI.
- Lists all remote branches and allows the user to select the base branch by number.
- Opens the pull request template for editing in Visual Studio Code.
- Pushes the current branch to the remote repository.
- Creates a pull request with the edited template.
- Automatically populates PR template details based on commit messages or branch name.
- Allows filling in other pull request data from the terminal, such as reviewers, assignees, labels, projects, and milestones.
- Git
- Zsh
- GitHub CLI (
gh
) - Visual Studio Code (ensure the
code
command is available in PATH)
-
Clone the repository:
git clone https://github.com/jesspsilva/pull-request-automation.git cd pull-request-automation
-
Ensure that the
code
command is available in your PATH:- Open Visual Studio Code.
- Open the Command Palette (⇧⌘P on macOS or Ctrl+Shift+P on Windows/Linux).
- Type and select
Shell Command: Install 'code' command in PATH
.
-
Make the script executable:
chmod +x create_pr.sh
-
Navigate to your local Git repository where you want to create a pull request.
-
Run the script:
./create_pr.sh
-
Follow the prompts:
- Select the base branch by entering the corresponding number.
- Edit the pull request template in Visual Studio Code. Save and close the file to proceed.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.