DocumentationWorkflowsApps and services

GitHub Pull Requests node

Pull requests in a repository: search, view, create, review or merge, e.g. automatically open a cleanup pull request from a workflow and only merge it once the checks are green. Learn how to configure it, map inputs and outputs, run a test and resolve common errors.

12 min readUpdated

What this node does

Pull requests in a repository: search, view, create, review or merge, e.g. automatically open a cleanup pull request from a workflow and only merge it once the checks are green.

Use GitHub Pull Requests as a clearly defined step in an anymize workflow.

  • Processes one input.
  • Provides one output for following steps.
  • Runs as a regular step in the flow.

Set up the node

  1. 01Open a workflow and add GitHub Pull Requests from the node catalog.
  2. 02If your GitHub account is not connected yet, connect it right in the node panel or under Connectors.
  3. 03Complete the required fields and map values from previous steps.
  4. 04Run the node with a small test record and inspect its output.
  5. 05Connect the successful output and activate the workflow after an end-to-end test.

Operations and modes

Choose the required function in Action. The panel then shows the relevant settings.

  • List PRs
  • Read PR
  • Create PR
  • Merge PR
  • Changed files
  • PR commits
  • Update PR
  • Update branch
  • Is it merged?
  • Request review
  • Withdraw review request
  • List reviews
  • Submit review
  • Line comments
  • Comment on line
  • Read check status

Settings

FieldMeaningArea
ActionChoices: List PRs, Read PR, Create PR, Merge PR, Changed files, PR commits, Update PR, Update branch, Is it merged?, Request review, Withdraw review request, List reviews, Submit review, Line comments, Comment on line, Read check statusStandard
Owner (user or org)The GitHub name the repo belongs to, e.g. anymize.Standard
RepositoryName of the repository, e.g. hello-world.Standard
StatusChoices: Open, Closed, AllStandard
Target branch onlyOnly pull requests that go into this branch, e.g. main.Standard
Source branch onlyIn the format owner:branch, e.g. anymize:feature/foo.Standard
Sort byChoices: Recently created, Recently updated, Most comments, Open the longestStandard
Count (max. 100)How many entries to load per request. No effect with "Load all pages", which always loads 100 per page.Standard
Load all pagesKeeps loading pages until everything is there, up to 1000 entries.Standard
PageWhich page to start from, e.g. the next page from the previous request. Empty: the first one. No effect with "Load all pages".Standard
PR no.Configure this value in the node panel.Standard
TitleConfigure this value in the node panel.Standard
Source branch (from)The branch with your changes, e.g. feature/foo.Standard
Target branch (into)The branch it gets merged into, usually main.Standard
TextDescription, review or comment. Markdown is supported.Standard
As draftConfigure this value in the node panel.Standard
Allow edits by maintainersConfigure this value in the node panel.Standard
Reviewed version (commit)The commit that was reviewed. If the pull request changed since then, nothing happens. Empty: the current version.Standard
Merge methodHow the PR is merged. When in doubt, pick „Merge commit“.Standard
Merge commit titleConfigure this value in the node panel.Standard
Merge commit messageConfigure this value in the node panel.Standard
Only with green checksOff: merges even if checks are missing or failing.Standard
New statusChoices: Don't change, Open, ClosedStandard
New target branchConfigure this value in the node panel.Standard
ReviewersGitHub names, separated by commas.Standard
Reviewing teamsTeam slugs, separated by commas.Standard
Outcome"Request changes" and "Comment" need a text.Standard
FilePath of the file in the repository, e.g. src/index.ts.Standard
LineConfigure this value in the node panel.Standard
SideNew version (right) or old version (left).Standard
CommitEmpty: the pull request's current version.Standard
Branch or commitConfigure this value in the node panel.Standard
GitHub accountLeave empty and the step uses your connected GitHub account.Standard
Run once per itemOff (default): the node runs once for the whole input. On: if it receives several items (e.g. from Split Out), it runs once PER item, and {{ $json }} is that one item each time. This is how you work through a file list entry by entry.Standard
If one item fails"Skip" writes an `error` field for the failed item and keeps processing the rest, instead of losing the whole run to a single unreadable file.Standard
Pause between items (milliseconds)Wait before every run except the first. 1000 = 1 second per item. Useful when the other side would otherwise throttle you. Maximum 300000 (5 minutes).Standard

Inputs and outputs

InputMeaningType
StandardReceives the complete result from the previous step.JSON
OutputMeaningType
StandardMakes the result available to the next step as JSON.JSON

This node can process lists item by item. Error handling and the delay between items are available in advanced settings.

Example and test run

Create an open PR from a workflow: begin with a small, recognizable record. Inspect the output and only map fields that are present there.

Test-run example

{
  "owner": "octocat",
  "repo": "hello-world",
  "head": "feat/copilot-tools",
  "base": "main",
  "title": "Add Copilot Tools"
}

Access and security

The node works with your own connected GitHub account. It only sees and changes what this account is allowed to. Check the permissions shown when you connect. The matching area (Issues, Pull Requests, Repos) must also be switched on in the settings of your GitHub connection under Connectors. All areas are on by default.

"Allowed actions" in the settings of your GitHub connection under Connectors also applies to this node and is checked on every run. With "Read only" or "Read and draft", only the read actions run: List PRs, Read PR, Changed files, PR commits, Is it merged?, List reviews, Line comments, Read check status. These actions need "Allow changes": Create PR, Merge PR, Update PR, Update branch, Request review, Withdraw review request, Submit review, Comment on line.

Keys and credentials belong in Workflow Secrets or your connected accounts. Never paste them as plain text into workflow fields, test data or descriptions.

Troubleshooting

  • No output: inspect the latest run and confirm that the previous node returned the expected fields.
  • Empty variable: open the previous step output and use a field name from the real test data.
  • Connection rejected: reconnect the service and grant the permissions required by this step.
  • Action blocked: set "Allowed actions" of the connection under Connectors to "Allow changes", or pick a read action.
  • List processed once: enable per-item execution in advanced settings.