`/pr` does not recognize GitHub repositories that use SSH host aliases
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### Describe the bug
When using Copilot CLI's `/pr` command in a repository whose origin remote uses an SSH host alias (defined in `~/.ssh/config`), the command fails with:
> The `/pr` command requires a repository connected to GitHub (github.com or *.ghe.com remote).
For example, my remote is:
git@github-personal:nickcoffey/PySwap.git
where `github-personal` is an SSH alias that resolves to github.com and uses a specific SSH key for one of multiple GitHub accounts.
The repository is a valid GitHub repository, and GitHub CLI recognizes it correctly (`gh repo view` succeeds). This suggests `/pr` is validating the literal remote hostname instead of resolving SSH aliases or using Git/GitHub metadata to determine the repository.
### Affected version
GitHub Copilot CLI 1.0.73.
### Steps to reproduce the behavior
1. Configure an SSH host alias in `~/.ssh/config` that resolves to `github.com`, for example:
```sshconfig
Host github-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_personal
```
2. Clone or configure a GitHub repository using the SSH alias as the remote:
```bash
git remote set-url origin git@github-personal:OWNER/REPO.git
```
3. Verify the repository is accessible:
```bash
gh repo view # this should succeed
```
4. Run the Copilot CLI `/pr` command from the repository.
### Expected behavior
`/pr` should work with repositories that use SSH host aliases which ultimately resolve to github.com or GitHub Enterprise hosts.
### Additional context
- **Operating system:** macOS
- **CPU architecture:** ARM
- **Terminal emulator:** Ghostty
- **Shell:** zsh
贡献指南
调研方向
从 `/pr` 命令的仓库验证和远程 URL 处理入手。使用 SSH 别名 `github-personal` 重现故障,并将其与成功的 `gh repo view` 检查进行比较;当 `/pr` 接受解析到 GitHub 主机的别名,同时保留正常的 GitHub Enterprise 支持时,即完成此项工作。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, github
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 58/100