In this guide

Merge a Pull Request

Merge, squash or rebase a pull request.

Action referenceChange

What this action does #

First, connect GitHub in Services. Then open Actions → + → GitHub and choose Merge a Pull Request.

What a run does

Running or testing this action changes something in your connected service.

More about this action

The repository decides which methods are allowed, so squash on a repository that forbids it is a 405 rather than a fallback to merge.

405 means the pull request cannot be merged as things stand: conflicts, a failing required check, a missing review. The message says which. 409 means the branch moved after Head SHA was read — the safety catch working as intended.

Set Head SHA from a Get a Pull Request step when the action must not merge something that changed underneath it.

Inputs to fill in #

Open an input to choose its value. Keep a fixed value with Text, receive it from Shortcuts, ask when the action runs, or use an Earlier Step. Read how input sources work.

Owner

RequiredText

User or organisation.

This input offers a picker for repository from your connected account. You can also supply its value directly.

Example value (replace with your own):
octocat

Repository

RequiredText

Name only, without the owner and without .git.

This input offers a picker for repository from your connected account. You can also supply its value directly.

Example value (replace with your own):
Hello-World

Pull Request Number

RequiredWhole number

The number shown in the interface.

This input offers a picker for pull request from your connected account. You can also supply its value directly.

Example value (replace with your own):
7

Method

OptionalChoice

Must be one the repository allows.

Choices: merge, squash, rebase

Default: merge

Commit Title

OptionalText

Defaults to GitHub's generated title.

Commit Message

OptionalText

Extra detail below the title.

Head SHA

OptionalText

Refuse the merge unless the branch is still at this commit.

Example value (replace with your own):
6dcb09b5b57875f334f61aebed695e2e4193db5e

What comes back #

In the action editor, open Output → Returned Value to choose fields for your shortcut. These are the response fields described by the app; a service may omit an optional field or return an empty list. JSON File contains the full response.

Returned fieldTypeMeaning
mergedbooleanTrue when the merge happened.
shastringThe merge commit.
messagestringHuman-readable result.

Run it from Shortcuts #

  1. Give the action a recognizable name and tap Save.
  2. In Apple Shortcuts, add Shortcutify’s Execute Action and select the saved action.
  3. Supply any Param or File slots you bound in the inputs, then run the shortcut.

If the result is unexpected, open Logs in Shortcutify, select the run, and inspect this step’s inputs and response.

Advanced reference #

Request, permissions, and identifiers

Request: PUT https://api.github.com/repos/{owner}/{repo}/pulls/{pull_number}/merge

Action identifier: github.pulls.merge.v1

Permissions declared for this action: pull_requests:write, contents:write. The account’s own access rules also apply.

InputRequest keyLocation
Ownerownerpath
Repositoryrepopath
Pull Request Numberpull_numberpath
Methodmerge_methodbody
Commit Titlecommit_titlebody
Commit Messagecommit_messagebody
Head SHAshabody

GitHub API reference