Skip to content

Commit

Permalink
fix(release): update regex for remote URL
Browse files Browse the repository at this point in the history
Updates remote URL regex to match on GitHub, GitHub Enterprise, and local git repositories.

Closes #23178
Closes #21906
  • Loading branch information
pcopley committed May 4, 2024
1 parent fd5ea92 commit 03110ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nx/src/command-line/release/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function getGitHubRepoSlug(remoteName = 'origin'): RepoSlug {
}).trim();

// Extract the 'user/repo' part from the URL
const regex = /github\.com[/:]([\w-]+\/[\w-]+)/;
const regex = /(?:github(?:\.|(?:(?:\.\w{2,}){1,})(?!\w))(?:[/:])|git@[\w.-]+:)([\w-]+\/[\w-]+)/;
const match = remoteUrl.match(regex);

if (match && match[1]) {
Expand Down

0 comments on commit 03110ea

Please sign in to comment.