Skip to content

create_pull_request

Community Action Reference: Inspected directly from Fastlane core ruby gem definitions.

Supported Platforms: ios, android, mac

This will create a new pull request on GitHub

Parameters & Options

Total options available: 14

Key Type Env Variable Default Required Description
api_token String GITHUB_PULL_REQUEST_API_TOKEN - No Personal API Token for GitHub - generate one at https://github.com/settings/tokens
api_bearer String GITHUB_PULL_REQUEST_API_BEARER - No Use a Bearer authorization token. Usually generated by GitHub Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable
repo String GITHUB_PULL_REQUEST_REPO - Yes The name of the repository you want to submit the pull request to
title String GITHUB_PULL_REQUEST_TITLE - Yes The title of the pull request
body String GITHUB_PULL_REQUEST_BODY - No The contents of the pull request
draft Fastlane::Boolean GITHUB_PULL_REQUEST_DRAFT - No Indicates whether the pull request is a draft
labels Array GITHUB_PULL_REQUEST_LABELS - No The labels for the pull request
milestone Numeric GITHUB_PULL_REQUEST_MILESTONE - No The milestone ID (Integer) for the pull request
head String GITHUB_PULL_REQUEST_HEAD git rev-parse --abbrev-ref HEAD No The name of the branch where your changes are implemented (defaults to the current branch name)
base String GITHUB_PULL_REQUEST_BASE master No The name of the branch you want your changes pulled into (defaults to master)
api_url String GITHUB_PULL_REQUEST_API_URL https://api.github.com No The URL of GitHub API - used when the Enterprise (default to https://api.github.com)
assignees Array GITHUB_PULL_REQUEST_ASSIGNEES - No The assignees for the pull request
reviewers Array GITHUB_PULL_REQUEST_REVIEWERS - No The reviewers (slug) for the pull request
team_reviewers Array GITHUB_PULL_REQUEST_TEAM_REVIEWERS - No The team reviewers (slug) for the pull request

Lane Context Shared Values

This action writes the following values to Actions.lane_context[SharedValues::...]:

Key Description
SharedValues::CREATE_PULL_REQUEST_HTML_URL The HTML URL to the created pull request
SharedValues::CREATE_PULL_REQUEST_NUMBER The identifier number of the created pull request

Examples

create_pull_request(
api_token: "secret", # optional, defaults to ENV["GITHUB_API_TOKEN"]
repo: "fastlane/fastlane",
title: "Amazing new feature",
head: "my-feature", # optional, defaults to current branch name
base: "master", # optional, defaults to "master"
body: "Please pull this in!", # optional
api_url: "http://yourdomain/api/v3" # optional, for GitHub Enterprise, defaults to "https://api.github.com"
)

Source & Upstream