🚀 [Feature]: Pull requests can now be listed, updated, and commented on#547
Draft
🚀 [Feature]: Pull requests can now be listed, updated, and commented on#547
Conversation
Copilot started work on behalf of
Marius Storhaug (MariusStorhaug)
February 9, 2026 09:43
View session
- Add GitHubPullRequest class - Add Get-GitHubPullRequest command (list and get by number) - Add Update-GitHubPullRequest command (close, update title, body, etc.) - Add New-GitHubPullRequestComment command (add comments to PRs) Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
- Use $Owner and $Repository instead of $OwnerName/$RepositoryName - Add examples demonstrating PR management use cases - Fix linter issues Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
- Add null checks for head/base repository properties - Write errors to error stream when PR not found - Address code review feedback Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add pull request management commands for automation
Add Pull Request management commands
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull requests in a repository can now be listed, filtered, retrieved by number, updated, and commented on directly from PowerShell. This removes the need to shell out to the
ghCLI for pull request automation scenarios such as closing superseded auto-update PRs.New: List and retrieve pull requests
Get-GitHubPullRequestlists pull requests in a repository with optional filtering by state, head branch, base branch, sort order, and direction. A specific pull request can also be retrieved by number.New: Update pull request state, title, and body
Update-GitHubPullRequestmodifies a pull request's title, body, state (open/closed), base branch, or maintainer modification flag. Supports pipeline input fromGet-GitHubPullRequest.New: Comment on pull requests
New-GitHubPullRequestCommentadds a comment to a pull request via the Issues API (since PRs are issues in the GitHub API). Supports pipeline input.Technical Details
GitHubPullRequestclass extendsGitHubNode, mapping REST API fields to PascalCase properties. Includes null-safe handling for deleted fork repositories in head/base repo references.src/functions/private/PullRequests/:Get-GitHubPullRequestList(GET /repos/{owner}/{repo}/pulls),Get-GitHubPullRequestByNumber(GET /repos/{owner}/{repo}/pulls/{pull_number}),Update-GitHubPullRequestByNumber(PATCH /repos/{owner}/{repo}/pulls/{pull_number}),New-GitHubPullRequestCommentByNumber(POST /repos/{owner}/{repo}/issues/{issue_number}/comments).filterkeyword,Resolve-GitHubContextinbeginblock,switchon$PSCmdlet.ParameterSetNamefor routing.Update-GitHubPullRequestandNew-GitHubPullRequestCommentuseSupportsShouldProcess.