Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.

External Documentation

To learn more, visit the GitHub documentation.

Parameters

ParameterDescription
BodyThe contents of the pull request.
OwnerThe organization or person who owns the repository. github.com//
RepoName of the repository owned by the owner. github.com//
Source BranchThe name of the branch where your changes are implemented.
Target BranchThe name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
TitleThe title of the new pull request.

Example Output

{
	"url": "<string>",
	"id": 3239091772,
	"node_id": "<string>",
	"html_url": "<string>",
	"diff_url": "<string>",
	"patch_url": "<string>",
	"issue_url": "<string>",
	"number": 7,
	"state": "<string>",
	"locked": false,
	"title": "<string>",
	"user": {
		"login": "<string>",
		"id": 63613409,
		"node_id": "<string>",
		"avatar_url": "<string>",
		"gravatar_id": "<string>",
		"url": "<string>",
		"html_url": "<string>",
		"followers_url": "<string>",
		"following_url": "<string>",
		"gists_url": "<string>",
		"starred_url": "<string>",
		"subscriptions_url": "<string>",
		"organizations_url": "<string>",
		"repos_url": "<string>",
		"events_url": "<string>",
		"received_events_url": "<string>",
		"type": "<string>",
		"user_view_type": "<string>",
		"site_admin": false
	},
	"body": null,
	"created_at": "2021-10-28T16:05:50Z",
	"updated_at": "2021-10-28T16:05:50Z",
	"closed_at": null,
	"merged_at": null,
	"merge_commit_sha": null,
	"assignee": null,
	"assignees": [],
	"requested_reviewers": [],
	"requested_teams": [],
	"labels": [],
	"milestone": null,
	"draft": false,
	"commits_url": "<string>",
	"review_comments_url": "<string>",
	"review_comment_url": "<string>",
	"comments_url": "<string>",
	"statuses_url": "<string>",
	"head": {
		"label": "<string>",
		"ref": "<string>",
		"sha": "<string>",
		"user": {
			"login": "<string>",
			"id": 46499854,
			"node_id": "<string>",
			"avatar_url": "<string>",
			"gravatar_id": "<string>",
			"url": "<string>",
			"html_url": "<string>",
			"followers_url": "<string>",
			"following_url": "<string>",
			"gists_url": "<string>",
			"starred_url": "<string>",
			"subscriptions_url": "<string>",
			"organizations_url": "<string>",
			"repos_url": "<string>",
			"events_url": "<string>",
			"received_events_url": "<string>",
			"type": "<string>",
			"user_view_type": "<string>",
			"site_admin": false
		},
		"repo": {
			"id": 78120159,
			"node_id": "<string>",
			"name": "<string>",
			"full_name": "<string>",
			"private": false,
			"owner": {
				"login": "<string>",
				"id": 181634932,
				"node_id": "<string>",
				"avatar_url": "<string>",
				"gravatar_id": "<string>",
				"url": "<string>",
				"html_url": "<string>",
				"followers_url": "<string>",
				"following_url": "<string>",
				"gists_url": "<string>",
				"starred_url": "<string>",
				"subscriptions_url": "<string>",
				"organizations_url": "<string>",
				"repos_url": "<string>",
				"events_url": "<string>",
				"received_events_url": "<string>",
				"type": "<string>",
				"user_view_type": "<string>",
				"site_admin": false
			},
			"html_url": "<string>",
			"description": null,
			"fork": false,
			"url": "<string>",
			"forks_url": "<string>",
			"keys_url": "<string>",
			"collaborators_url": "<string>",
			"teams_url": "<string>",
			"hooks_url": "<string>",
			"issue_events_url": "<string>",
			"events_url": "<string>",
			"assignees_url": "<string>",
			"branches_url": "<string>",
			"tags_url": "<string>",
			"blobs_url": "<string>",
			"git_tags_url": "<string>",
			"git_refs_url": "<string>",
			"trees_url": "<string>",
			"statuses_url": "<string>",
			"languages_url": "<string>",
			"stargazers_url": "<string>",
			"contributors_url": "<string>",
			"subscribers_url": "<string>",
			"subscription_url": "<string>",
			"commits_url": "<string>",
			"git_commits_url": "<string>",
			"comments_url": "<string>",
			"issue_comment_url": "<string>",
			"contents_url": "<string>",
			"compare_url": "<string>",
			"merges_url": "<string>",
			"archive_url": "<string>",
			"downloads_url": "<string>",
			"issues_url": "<string>",
			"pulls_url": "<string>",
			"milestones_url": "<string>",
			"notifications_url": "<string>",
			"labels_url": "<string>",
			"releases_url": "<string>",
			"deployments_url": "<string>",
			"created_at": "2021-10-28T16:05:50Z",
			"updated_at": "2021-10-28T16:05:50Z",
			"pushed_at": "2021-10-28T16:05:50Z",
			"git_url": "<string>",
			"ssh_url": "<string>",
			"clone_url": "<string>",
			"svn_url": "<string>",
			"homepage": null,
			"size": 53,
			"stargazers_count": 1,
			"watchers_count": 1,
			"language": "<string>",
			"has_issues": true,
			"has_projects": true,
			"has_downloads": true,
			"has_wiki": true,
			"has_pages": false,
			"has_discussions": false,
			"forks_count": 1,
			"mirror_url": null,
			"archived": false,
			"disabled": false,
			"open_issues_count": 2,
			"license": null,
			"allow_forking": true,
			"is_template": false,
			"web_commit_signoff_required": false,
			"topics": [],
			"visibility": "<string>",
			"forks": 1,
			"open_issues": 2,
			"watchers": 1,
			"default_branch": "<string>"
		}
	},
	"base": {
		"label": "<string>",
		"ref": "<string>",
		"sha": "<string>",
		"user": {
			"login": "<string>",
			"id": 30878208,
			"node_id": "<string>",
			"avatar_url": "<string>",
			"gravatar_id": "<string>",
			"url": "<string>",
			"html_url": "<string>",
			"followers_url": "<string>",
			"following_url": "<string>",
			"gists_url": "<string>",
			"starred_url": "<string>",
			"subscriptions_url": "<string>",
			"organizations_url": "<string>",
			"repos_url": "<string>",
			"events_url": "<string>",
			"received_events_url": "<string>",
			"type": "<string>",
			"user_view_type": "<string>",
			"site_admin": false
		},
		"repo": {
			"id": 1429786250,
			"node_id": "<string>",
			"name": "<string>",
			"full_name": "<string>",
			"private": false,
			"owner": {
				"login": "<string>",
				"id": 64741134,
				"node_id": "<string>",
				"avatar_url": "<string>",
				"gravatar_id": "<string>",
				"url": "<string>",
				"html_url": "<string>",
				"followers_url": "<string>",
				"following_url": "<string>",
				"gists_url": "<string>",
				"starred_url": "<string>",
				"subscriptions_url": "<string>",
				"organizations_url": "<string>",
				"repos_url": "<string>",
				"events_url": "<string>",
				"received_events_url": "<string>",
				"type": "<string>",
				"user_view_type": "<string>",
				"site_admin": false
			},
			"html_url": "<string>",
			"description": null,
			"fork": false,
			"url": "<string>",
			"forks_url": "<string>",
			"keys_url": "<string>",
			"collaborators_url": "<string>",
			"teams_url": "<string>",
			"hooks_url": "<string>",
			"issue_events_url": "<string>",
			"events_url": "<string>",
			"assignees_url": "<string>",
			"branches_url": "<string>",
			"tags_url": "<string>",
			"blobs_url": "<string>",
			"git_tags_url": "<string>",
			"git_refs_url": "<string>",
			"trees_url": "<string>",
			"statuses_url": "<string>",
			"languages_url": "<string>",
			"stargazers_url": "<string>",
			"contributors_url": "<string>",
			"subscribers_url": "<string>",
			"subscription_url": "<string>",
			"commits_url": "<string>",
			"git_commits_url": "<string>",
			"comments_url": "<string>",
			"issue_comment_url": "<string>",
			"contents_url": "<string>",
			"compare_url": "<string>",
			"merges_url": "<string>",
			"archive_url": "<string>",
			"downloads_url": "<string>",
			"issues_url": "<string>",
			"pulls_url": "<string>",
			"milestones_url": "<string>",
			"notifications_url": "<string>",
			"labels_url": "<string>",
			"releases_url": "<string>",
			"deployments_url": "<string>",
			"created_at": "2021-10-28T16:05:50Z",
			"updated_at": "2021-10-28T16:05:50Z",
			"pushed_at": "2021-10-28T16:05:50Z",
			"git_url": "<string>",
			"ssh_url": "<string>",
			"clone_url": "<string>",
			"svn_url": "<string>",
			"homepage": null,
			"size": 1,
			"stargazers_count": 0,
			"watchers_count": 2,
			"language": "<string>",
			"has_issues": true,
			"has_projects": true,
			"has_downloads": true,
			"has_wiki": true,
			"has_pages": false,
			"has_discussions": false,
			"forks_count": 2,
			"mirror_url": null,
			"archived": false,
			"disabled": false,
			"open_issues_count": 2,
			"license": null,
			"allow_forking": true,
			"is_template": false,
			"web_commit_signoff_required": false,
			"topics": [],
			"visibility": "<string>",
			"forks": 2,
			"open_issues": 1,
			"watchers": 0,
			"default_branch": "<string>"
		}
	},
	"_links": {
		"self": {
			"href": "<string>"
		},
		"html": {
			"href": "<string>"
		},
		"issue": {
			"href": "<string>"
		},
		"comments": {
			"href": "<string>"
		},
		"review_comments": {
			"href": "<string>"
		},
		"review_comment": {
			"href": "<string>"
		},
		"commits": {
			"href": "<string>"
		},
		"statuses": {
			"href": "<string>"
		}
	},
	"author_association": "<string>",
	"auto_merge": null,
	"active_lock_reason": null,
	"merged": false,
	"mergeable": null,
	"rebaseable": null,
	"mergeable_state": "<string>",
	"merged_by": null,
	"comments": 1,
	"review_comments": 2,
	"maintainer_can_modify": false,
	"commits": 1,
	"additions": 2,
	"deletions": 2,
	"changed_files": 1
}

Workflow Library Example

on New Push Event on Github Scan for Credentials and Handle Findings

Preview this Workflow on desktop