View as Markdown
GitHub icon

GitHub ACTION

Create Pull Request

Open a pull request proposing to merge one branch into another within a repository. Provide the repository as an owner/repo string, the head branch (the source containing your changes) and the base branch (the target, e.g. main), plus a title. The head and base branches must already exist and differ. For a cross-fork PR, set head to username:branch. Use Create or Update File Contents to push changes to a branch before opening the PR. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's GitHub account once, then configure and run Create Pull Request from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "github-create-pull-request",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    github: { authProvisionId: "apn_xxxxxxx" },
    repoFullname: "Repository",
    head: "Head Branch",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Pull Request inputs
Property Type Description
repoFullname Repository string
The repository in owner/repo format, for example PipedreamHQ/pipedream (not case sensitive). If you pass just a repository name with no owner (e.g. my-repo), the authenticated user is assumed as the owner — convenient for "my repo" requests. Do NOT repeat the repository name as the owner (e.g. my-repo/my-repo); if you don't know the owner, pass only the name or run List Repositories to find it.
Required
head Head Branch string
The source branch containing the changes, e.g. feature/new-paddock. For a cross-fork PR, use username:branch.
Required
base Base Branch string
The target branch the changes will be merged into, e.g. main.
Required
title Title string
The title of the pull request.
Required
body Body string
The text description of the pull request. Supports GitHub-flavored Markdown.
Optional
draft Is Draft boolean
Whether to open the pull request as a draft.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
github-create-pull-request
Version
1.0.3
App
GitHub
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes