github.pulls.create_pr ​
Create a GitHub pull request
Create a pull request on a GitHub repository.
Inputs:
- owner: Repository owner (required).
- repo: Repository name (required).
- title: PR title (required).
- head: Source branch name (required), e.g. feature/my-feature.
- base: Target branch name (required), e.g. main.
- body: PR description in markdown (optional).
- draft: Open as a draft PR (optional, default: false).
Outputs (terminal state_data):
- pr_number: int — pull request number
- pr_url: str — HTML URL of the PR
- state: str — open | closed
Plugin required: context.get_plugin("github") must expose .token.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-github |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
owner | string | Yes | — | Repository owner |
repo | string | Yes | — | Repository name |
title | string | Yes | — | PR title |
head | string | Yes | — | Source branch, e.g. feature/my-feature |
base | string | Yes | — | Target branch, e.g. main |
body | string | No | — | PR description in markdown |
draft | boolean | No | — | Open as a draft PR (default: false) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
pr_number | integer | No | — | — |
pr_url | string | No | — | — |
state | string | No | — | — |
base | string | No | — | — |
body | string | No | — | — |
draft | boolean | No | — | — |
head | string | No | — | — |
owner | string | No | — | — |
repo | string | No | — | — |
title | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "github.pulls.create_pr",
"initial_data": {
"owner": "value",
"repo": "value",
"title": "value",
"head": "value"
}
}