-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
bugSomething isn't workingSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsneeds-triageneeds to be reviewedneeds to be reviewedp1Affects a large population and inhibits workAffects a large population and inhibits work
Description
Describe the bug
Hi dear team!
After upgrading to GitHub CLI 2.66.0
we noticed that running gh pr <cmd> <url>
fails with the message:
The error message was the following:
could not determine current branch: failed to run git: fatal: not a git repository (or any of the parent directories): .git
It happens when we run the commands outside of git repository.
We use the gh pr
command in composite action, providing a valid token and using ${{ github.event.pull_request.html_url }}
as PR URL. Previous versions worked without checking out the repository.
Affected version
2.66.0
Steps to reproduce the behavior
- Upgrade to GitHub CLI 2.66.0
- Run any
gh pr
subcommand (e.g.gh pr view <url>
) outside of git repository - See error:
could not determine current branch: failed to run git: fatal: not a git repository (or any of the parent directories): .git
Expected vs actual behavior
Earlier version of gh pr
worked in our workflows without checking out the repository.
We would expect it to work, since we use gh pr
with explicit PR URL, in which base and head branches are set.
TimothyLoyer, neutrinoceros, surgiie, mklauber, wizardemoji and 3 moreandyfeller, surgiie and tonirvega
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsneeds-triageneeds to be reviewedneeds to be reviewedp1Affects a large population and inhibits workAffects a large population and inhibits work