GH should not require git repository to exist where operation does not affect one #9072
Labels
bug
Something isn't working
discuss
Feature changes that require discussion primarily among the GitHub CLI team
gh-run
relating to the gh run command
needs-triage
needs to be reviewed
Describe the bug
I've attempted to use
gh run cancel <id>
from a directory that was not a repository.While the cancel operation would've proceeded normally due to having GH_TOKEN in the env, gh started balking at not being in a git repository. When I initialized the directory with
git init
as a workaround,gh run cancel
further complained there were no remotes in the repository.Case 1 (empty dir):
https://github.com/karellen/karellen-llvm/actions/runs/9047154513/job/24858809382#step:2:26
Case 2 (git init with no remotes):
https://github.com/karellen/karellen-llvm/actions/runs/9047223038/job/24858879136#step:2:39
Version is 2.49.0.
Steps to reproduce the behavior
The exact code is linked above in the publicly accessible workflows.
Expected vs actual behavior
Expected: GH CLI has no git repository requirements for operations not affecting git repositories.
Actual: GH CLI performs git repository validation for operations not affecting git repositories.
Logs
Linked above in the action runs.
The text was updated successfully, but these errors were encountered: