Closed Danl2620 closed 3 years ago
I think this can be chalked up to a poor cmdlet API design on my part back when I refactored this module for 0.2.0.
I designed it to literally follow the same structure that the API itself uses (as discussed here).
With the current implementation, you need to follow the format for head
as discussed in that API documentation and in the cmdlet help (as seen here as well), where you have to specify head
in the format user:ref-name
. Of course, the cmdlet doesn't do attempt to do anything to validate that the user used the right syntax (doh!).
So, for your example, you'd currently need to use:
$Repo | Get-GitHubPullRequest -state "open" -head "$($Repo.owner.login):asdf"
At the very least, I should add a validation check for that syntax to help users from misusing that parameter in the future. Even better would be to either update the parameter design to allow the user
and ref-name
to be specified separately, and/or have the user
default to be the OwnerName
of the repo being used.
Thanks, that syntax works!
A description of your problem or question
I'd like to find all pull requests that use branch "asdf" as their head/source.
Steps to reproduce the issue
Verbose logs showing the problem
This command just shows all open pull requests, regardless of source branch.
Suggested solution to the issue
Get-GitHubPullRequest -Head <ref>
takes the name of a branch.Operating System
PowerShell Version
Module Version
Running: 0.16.0 Installed: 0.16.0