github / github/vscode-github-actions
No GitHub repositories found when using SSH aliases
- Ngôn ngữ chính
- TypeScript
- Star
- 660
- Fork
- 213
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**Describe the bug**
When using SSH config aliases (see the example below), the GitHub Actions extension returns the error message "No GitHub repositories found". SSH aliases are often used when a user has multiple GitHub accounts that have separate SSH keys.
This only occurs when using an alias that does not include `github.com` in the alias name. If I were to change the alias name to, for example, `personal.github.com`, as well as the remote, then the extension works without issue.
**To Reproduce**
Steps to reproduce the behavior:
1. Create an alias in your SSH config file (e.g., ~/.ssh/config) with any name that does not include `github.com`.
2. Switch your origin remote to use the alias (e.g., git@alias:username/repo.git)
3. Reload VSCode
4. Switch to the GitHub Actions extension and see "No GitHub repositories found"
5. Switch your origin remote back to a standard "github.com" alias
6. Reload VSCode
7. Switch to the GitHub Actions extension and see standard functionality.
**Expected behavior**
GitHub Actions would work regardless of the SSH config alias.
**Extension Version**
`v0.27.2`
**Additional context**
Logs from the extension when using a non-github.com alias:
```
Activating GitHub Actions extension...
Error getting GitHub context
Invalid URL
TypeError: Invalid URL
at new URL (node:internal/url:818:25)
at /Users/josephgruber/.vscode/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1158030
at async Promise.all (index 0)
at async /Users/josephgruber/.vscode/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1157669
at async De (/Users/josephgruber/.vscode/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1157518)
at async os (/Users/josephgruber/.vscode/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1339675)
at async Lb.n (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13382)
at async Lb.m (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13345)
at async Lb.l (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12801)
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi quá trình kích hoạt extension và tra cứu ngữ cảnh GitHub, vốn thất bại với Invalid URL khi remote sử dụng bí danh SSH không phải github.com. Tái hiện lỗi bằng cấu hình SSH và các dạng remote được mô tả trong issue, sau đó xác minh rằng việc phát hiện repository hoạt động với cả remote GitHub có bí danh và remote GitHub tiêu chuẩn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- git, github-actions, typescript, vscode
- Lĩnh vực
- developer-experience, tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100