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.
Describe the bug
Hi dear team!
After upgrading to GitHub CLI
2.66.0we noticed that runninggh pr <cmd> <url>fails with the message:The error message was the following:
It happens when we run the commands outside of git repository.
We use the
gh prcommand 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.0Steps to reproduce the behavior
gh prsubcommand (e.g.gh pr view <url>) outside of git repositoryExpected vs actual behavior
Earlier version of
gh prworked in our workflows without checking out the repository.We would expect it to work, since we use
gh prwith explicit PR URL, in which base and head branches are set.