github / github/vscode-github-actions

GHE.com support broken for SSH/Git remote URLs

未關閉
#502 1 則留言 8 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
660
分支
213
PR 合併指標
30 天內沒有已合併 PR

描述

**Describe the bug**

It appears that the implementation of https://github.com/github/vscode-github-actions/issues/457 through https://github.com/github/vscode-github-actions/pull/458 was broken by https://github.com/github/vscode-github-actions/pull/469 if you are not using http remote urls and instead use the SSH/Git remote urls, e.g. `@.ghe.com:org/repo.git`.

Log output:

```
Activating GitHub Actions extension...
Error getting GitHub context
Invalid URL
TypeError: Invalid URL
at new URL (node:internal/url:818:25)
at /home/gustav/.vscode-server/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1158030
at async Promise.all (index 0)
at async /home/gustav/.vscode-server/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1157669
at async De (/home/gustav/.vscode-server/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1157518)
at async os (/home/gustav/.vscode-server/extensions/github.vscode-github-actions-0.27.2/dist/extension-node.js:1:1339675)
at async db.n (file:///home/gustav/.vscode-server/bin/488a1f239235055e34e673291fb8d8c810886f81/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
at async db.m (file:///home/gustav/.vscode-server/bin/488a1f239235055e34e673291fb8d8c810886f81/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
at async db.l (file:///home/gustav/.vscode-server/bin/488a1f239235055e34e673291fb8d8c810886f81/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)

```

**To Reproduce**
Steps to reproduce the behavior:
1. Set up a repo on a ghe.com instance. Add VS Code settings as follow:
```json
{
"github-enterprise.uri": "https://.ghe.com",
"github-actions.use-enterprise": true
}
```
2. Check out the repository using the git/ssh remote:
```sh
git clone @.ghe.com:org/repo.git
```
3. The Github Actions extension will fail to initialize due to [`URL` failing to parse](https://github.com/github/vscode-github-actions/blob/8850a664b7dfd05efca1e00adc0d338f5ce296ab/src/git/repository.ts#L81) `@.ghe.com:org/repo.git` as a URL which then throws an error which is not handled.

**Screenshots**

**Extension Version**
`v0.27.2`

**Additional context**

貢獻指南

開啟貢獻指南

研究方向

The failure is identified in src/git/repository.ts at line 81; reproduce it with the documented ghe.com SSH remote and enterprise settings, then inspect how that value is parsed. Done means the extension initializes successfully for the SSH/Git remote without the Invalid URL error.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
git, typescript, vscode
領域
devtools
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。