Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Cleanup : Regex for github.com and GHE can be unified to a single one #2415

Open
kavishdahekar opened this issue Aug 2, 2024 · 0 comments

Comments

@kavishdahekar
Copy link

kavishdahekar commented Aug 2, 2024

Currently, the findGitSlug method relies on two separate regexes for identifying a github.com or a GHE ___domain from a given repo URL.

  1. Although findGitSlug returns either "CodeCommit", "GitHub" or "GitHubEnterprise" - this return value is never used elsewhere.
  2. The code does not differentiate between github.com and GHE ___domain elsewhere, so a single regex is sufficient to extract both : ^https?://([^/]+)/(.+)/(.+?)(?:\.git)?$

If acceptable, I would be happy to make this fix and modify the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant