-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Summary
The GitHub PowerShell module is currently missing commands for managing pull requests. These are needed for automation scenarios such as listing/filtering PRs, adding comments, and closing superseded PRs.
Missing commands
The following commands (or equivalents) would be valuable additions to the module:
Get-GitHubPullRequest
- List/filter pull requests by state, head branch, base branch, etc.
- Get a specific pull request by number.
- Similar to
GET /repos/{owner}/{repo}/pullsandGET /repos/{owner}/{repo}/pulls/{pull_number}.
New-GitHubPullRequestComment
- Add a comment to a pull request (via the issues comments endpoint).
- Similar to
POST /repos/{owner}/{repo}/issues/{issue_number}/comments.
Set-GitHubPullRequest / Update-GitHubPullRequest
- Update a pull request's state (e.g., close it), title, body, base branch, etc.
- Similar to
PATCH /repos/{owner}/{repo}/pulls/{pull_number}.
Use case
In the PSModule/GoogleFonts repository, an automated workflow updates font data and creates a PR. When a new Auto-Update PR is created, older Auto-Update PRs should be commented on (explaining they are superseded) and then closed. This requires the ability to:
- List open PRs filtered by head branch or title pattern
- Add a comment to a PR
- Close a PR by updating its state
Currently we work around this by using the gh CLI directly, but native PowerShell commands in the GitHub module would be preferred for consistency and better integration with the rest of the module.
Related
- REST API: Pulls
- REST API: Issue Comments
Metadata
Metadata
Assignees
Labels
Type
Projects
Status