Skip to content

Add pull request management functions #389

Open

Description

Context

The GitHub PowerShell module is used to automate repository management tasks. Pull request management is a fundamental part of GitHub workflows — listing PRs, updating their state, requesting reviewers, managing assignees, and controlling auto-merge settings.

Request

The module has no commands for interacting with pull requests. There is no way to list, create, update, merge, or manage pull requests through the module. The only workaround is shelling out to the gh CLI, which breaks consistency with the module's typed object pipeline experience.

Desired capability

Full pull request lifecycle management through PowerShell commands, covering:

  1. CRUD operations — create, list, get, and update pull requests
  2. Auto-merge — enable and disable auto-merge on pull requests
  3. Reviewers — request and remove pull request reviewers
  4. Assignees — list, check, add, and remove assignees on issues/PRs

REST API endpoints

Function Method Endpoint Documentation
New-GitHubPullRequest POST /repos/{owner}/{repo}/pulls Create a pull request
Get-GitHubPullRequest (list) GET /repos/{owner}/{repo}/pulls List pull requests
Get-GitHubPullRequest (get) GET /repos/{owner}/{repo}/pulls/{pull_number} Get a pull request
Update-GitHubPullRequest PATCH /repos/{owner}/{repo}/pulls/{pull_number} Update a pull request
Enable-GitHubPullRequestAutoMerge GraphQL enablePullRequestAutoMerge Mutation
Disable-GitHubPullRequestAutoMerge GraphQL disablePullRequestAutoMerge Mutation
Add-GitHubPullRequestReviewer POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers Request reviewers
Remove-GitHubPullRequestReviewer DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers Remove reviewers
Get-GitHubAssignee GET /repos/{owner}/{repo}/assignees List assignees
Test-GitHubAssignee GET /repos/{owner}/{repo}/assignees/{assignee} Check assignee
Add-GitHubAssignee POST /repos/{owner}/{repo}/issues/{issue_number}/assignees Add assignees
Remove-GitHubAssignee DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees Remove assignees

Acceptance criteria

  • Pull requests can be created, listed, retrieved, and updated
  • Auto-merge can be enabled and disabled on pull requests
  • Reviewers can be requested and removed
  • Assignees can be listed, tested, added, and removed
  • All commands follow module conventions

Related issues


Technical decisions

Phased implementation: This is an epic covering the full pull request API surface. The initial subset (Get, Update, Add-Comment) is tracked in #546 with a detailed implementation plan. This issue tracks the remaining scope.

Function grouping: Pull request functions go under src/functions/public/Pull-Requests/ and src/functions/private/Pull-Requests/. Assignee functions go under src/functions/public/Issues/ and src/functions/private/Issues/ since the assignee API is part of the issues endpoint.

Auto-merge uses GraphQL: The enable/disable auto-merge functionality is only available via GraphQL mutations, not REST. These functions will use Invoke-GitHubGraphQLQuery instead of Invoke-GitHubAPI.


Implementation plan

Phase 1 (tracked in #546)

  • Get-GitHubPullRequest — list and get by number
  • Update-GitHubPullRequest — update state, title, body, base
  • Add-GitHubPullRequestComment — post a comment on a PR

Phase 2

  • New-GitHubPullRequest — create a pull request
  • Enable-GitHubPullRequestAutoMerge — GraphQL mutation
  • Disable-GitHubPullRequestAutoMerge — GraphQL mutation
  • Add-GitHubPullRequestReviewer — request reviewers
  • Remove-GitHubPullRequestReviewer — remove requested reviewers

Phase 3 — Assignees

  • Get-GitHubAssignee — list assignees for a repo
  • Test-GitHubAssignee — check if a user can be assigned
  • Add-GitHubAssignee — add assignees to an issue/PR
  • Remove-GitHubAssignee — remove assignees from an issue/PR

Activity

  1. changed the title [-]🚀[Feature]: Add support for `PullRequests`[/-] [+]Add pull request management functions[/+] on Apr 4, 2026
  2. MariusStorhaug commented on Apr 4, 2026

    @MariusStorhaug
    MemberAuthor

    Restructured issue description into the standard three-section format.

    • Rewrote context and request to describe the user-facing gap (no PR management commands)
    • Added structured API endpoint table with documentation links for all 12 endpoints
    • Added technical decisions covering phased implementation, function grouping, and GraphQL requirement for auto-merge
    • Created phased implementation plan: Phase 1 (tracked in Add Get, Update, and Comment commands for pull requests #546), Phase 2 (PR creation, auto-merge, reviewers), Phase 3 (assignees)
    • Set issue type to Epic since this encompasses multiple features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions