[PR #1382] [CLOSED] fix: regex pattern for HTTPS GitHub URLs in CLI command, closes #1361 #9913

Closed
opened 2026-02-16 18:14:22 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1382
Author: @bitfrost
Created: 7/28/2025
Status: Closed

Base: devHead: issue_1361_fix


📝 Commits (1)

  • 6159fa6 FIX: issue 1361, bad regex for https:// synced repos (github cmd)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/opencode/src/cli/cmd/github.ts (+1 -1)

📄 Description

Fix regex pattern for HTTPS GitHub URLs in CLI command

Bug Description: The second regex pattern on line 192 in packages/opencode/src/cli/cmd/github.ts was not properly matching HTTPS GitHub URLs. The pattern /github.com/(.*).git/ only looked for github.com/ but failed to account for the https:// protocol prefix in HTTPS URLs.

Issue:

SSH URLs worked: git@github.com:sst/opencode.git
HTTPS URLs failed: https://github.com/sst/opencode.git

Root Cause: The regex /github.com/(.*).git/ expected URLs to start directly with github.com/ but HTTPS URLs actually start with https://github.com/.

Fix: Updated the second regex pattern from:

/github.com/(.*).git/

To:

/https://github.com/(.*).git/

Result: Now both SSH and HTTPS GitHub remote URLs are properly parsed:

SSH: git@github.com:sst/opencode.git → captures sst/opencode
HTTPS: https://github.com/sst/opencode.git → captures sst/opencode


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1382 **Author:** [@bitfrost](https://github.com/bitfrost) **Created:** 7/28/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `issue_1361_fix` --- ### 📝 Commits (1) - [`6159fa6`](https://github.com/anomalyco/opencode/commit/6159fa62d91fe728ba911149f4e8131358fe25e2) FIX: issue 1361, bad regex for https:// synced repos (github cmd) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/cli/cmd/github.ts` (+1 -1) </details> ### 📄 Description ## Fix regex pattern for HTTPS GitHub URLs in CLI command Bug Description: The second regex pattern on line 192 in packages/opencode/src/cli/cmd/github.ts was not properly matching HTTPS GitHub URLs. The pattern /github\.com\/(.*)\.git/ only looked for github.com/ but failed to account for the https:// protocol prefix in HTTPS URLs. Issue: • ✅ SSH URLs worked: git@github.com:sst/opencode.git • ❌ HTTPS URLs failed: https://github.com/sst/opencode.git Root Cause: The regex /github\.com\/(.*)\.git/ expected URLs to start directly with github.com/ but HTTPS URLs actually start with https://github.com/. Fix: Updated the second regex pattern from: /github\.com\/(.*)\.git/ To: /https:\/\/github\.com\/(.*)\.git/ Result: Now both SSH and HTTPS GitHub remote URLs are properly parsed: • ✅ SSH: git@github.com:sst/opencode.git → captures sst/opencode • ✅ HTTPS: https://github.com/sst/opencode.git → captures sst/opencode --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:22 -05:00
yindo closed this issue 2026-02-16 18:14:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9913