GitHub Create Pull Request

GitHub Create Pull Request

Create a pull request in a GitHub repository

Node Type

Action

Category

GitHub

Icon

GitPullRequest

Overview

The GitHub Create Pull Request node is an action node that creates pull requests in GitHub repositories. This powerful integration enables automated pull request creation within workflows, perfect for code review processes, feature branch management, and automated development workflows.

Key Features

  • Automated PR Creation: Create pull requests programmatically from workflows
  • Flexible Repository Input: Accept GitHub URLs or owner/repo format
  • Branch Management: Specify head and base branches for the pull request
  • Rich Content: Include detailed titles and descriptions
  • Dynamic Repository Selection: Automatically populate available repositories
  • Comprehensive Output: Returns PR number, URL, and success status

Prerequisites

GitHub Integration

Must have GitHub OAuth integration configured

GitHub OAuth token with repository access
Valid GitHub account with repository permissions
Repository access for the target repositories

Repository Access

Access to the target GitHub repository

Write access to the target repository
Permission to create pull requests
Valid repository URL or owner/repo format

Technical Requirements

System capabilities needed

GitHub Integration: Access to GitHub service through NodeServiceRegistry
Network Access: Internet connectivity for GitHub API communication
Error Handling: Proper exception handling for API failures

Node Configuration

Required Fields

Repository

Type:dynamic_select
Required:Yes
Value Type:string

Repository URL or owner/repo format (e.g., https://github.com/acme/tools or acme/tools). The node will automatically parse and validate the repository format.

Title

Type:text
Required:Yes
Value Type:string

The title of the pull request. This should be clear and descriptive to help reviewers understand the changes.

Head (branch)

Type:text
Required:Yes
Value Type:string

Name of the branch where your changes are implemented. This is the branch that contains the changes you want to merge.

Base (branch)

Type:text
Required:Yes
Value Type:string

Name of the branch you want the changes pulled into. This is typically 'main' or 'master' for the primary branch.

Optional Fields

Body

Type:text
Required:No
Value Type:string

Optional description of the pull request. This can include details about the changes, testing instructions, or any other relevant information for reviewers.

Best Practices

Do's

  • Use clear and descriptive PR titles that explain the purpose
  • Include detailed descriptions in the body field for better context
  • Ensure the head branch exists and contains your changes
  • Use consistent naming conventions for branches
  • Test with different repository formats (URL vs owner/repo)
  • Include relevant information about changes in the PR body
  • Verify repository access before creating PRs

Don'ts

  • Don't create PRs without proper branch setup
  • Avoid vague or unclear PR titles
  • Don't forget to specify the correct base branch
  • Avoid creating PRs to non-existent repositories
  • Don't ignore error handling for repository access issues
  • Avoid creating PRs without proper GitHub integration setup
  • Don't assume repository access without verification
💡
Pro Tip: When using dynamic repository selection, the node will automatically populate available repositories from your GitHub account. This makes it easy to select the correct repository without manually typing the full path.

Troubleshooting

Common Issues

Repository Access Issues

Symptoms: Node fails with repository access or permission errors

Solution: Verify that your GitHub OAuth token has the necessary permissions for the target repository. Ensure you have write access to the repository and can create pull requests.

Invalid Repository Format

Symptoms: Node fails with repository format errors

Solution: Ensure the repository is specified in the correct format: either as a full GitHub URL (https://github.com/owner/repo) or as owner/repo. The node will automatically parse and validate the format.

Branch Not Found

Symptoms: Node fails because the specified head or base branch doesn't exist

Solution: Verify that both the head branch (containing your changes) and base branch (target branch) exist in the repository. Ensure branch names are spelled correctly and match the actual branch names in GitHub.

GitHub Integration Not Configured

Symptoms: Node fails with GitHub access token not found errors

Solution: Ensure that GitHub OAuth integration is properly configured in your system. Verify that the integration service is registered and that valid GitHub credentials are available.

Duplicate Pull Request

Symptoms: Node fails when trying to create a PR that already exists

Solution: Check if a pull request already exists for the same head and base branch combination. GitHub doesn't allow duplicate PRs for the same branch pair.

Related Resources